From dd047aadde3ec9ce8e4902bfb8963675e863189c Mon Sep 17 00:00:00 2001 From: Felix Van der Jeugt Date: Wed, 17 Feb 2021 09:49:37 +0100 Subject: [PATCH] inline build database script --- .github/workflows/static_database.yml | 14 +++++++++++++- workflows/static_database/build_database.sh | 12 ------------ 2 files changed, 13 insertions(+), 13 deletions(-) delete mode 100755 workflows/static_database/build_database.sh diff --git a/.github/workflows/static_database.yml b/.github/workflows/static_database.yml index db75a5e..79e1d13 100644 --- a/.github/workflows/static_database.yml +++ b/.github/workflows/static_database.yml @@ -30,7 +30,19 @@ jobs: run: ./run.sh static-database - name: Build SQLite database from generated files shell: bash - run: ./workflows/static_database/build_database.sh + run: | + # Initialize the database + sqlite3 output.db < workflows/static_database/structure.sql + + # Read all generated data into this database + zcat data/tables/ec_numbers.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin ec_numbers' + zcat data/tables/go_terms.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin go_terms' + zcat data/tables/interpro_entries.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin interpro_entries' + zcat data/tables/taxons.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin taxons' + zcat data/tables/lineages.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin lineages' + + # Compress the database before uploading it to a Github release + zip output.zip output.db - name: Update database versioning shell: bash run: | diff --git a/workflows/static_database/build_database.sh b/workflows/static_database/build_database.sh deleted file mode 100755 index 948a3d8..0000000 --- a/workflows/static_database/build_database.sh +++ /dev/null @@ -1,12 +0,0 @@ -# Initialize the database -cat workflows/static_database/structure.sql | sqlite3 output.db - -# Read all generated data into this database -zcat data/tables/ec_numbers.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin ec_numbers' -zcat data/tables/go_terms.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin go_terms' -zcat data/tables/interpro_entries.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin interpro_entries' -zcat data/tables/taxons.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin taxons' -zcat data/tables/lineages.tsv.gz | sed "s/\t/$/g" | sqlite3 -csv -separator "$" output.db '.import /dev/stdin lineages' - -# Compress the database before uploading it to a Github release -zip output.zip output.db