Skip to content

Commit

Permalink
Remove old, gzip auto
Browse files Browse the repository at this point in the history
  • Loading branch information
hexylena committed Sep 13, 2016
1 parent 3bb53ca commit bcac011
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ cd "Chado-${BRANCH}/chado/" || exit;
patch -p1 < /opt/fix_relationshiptype_lc.diff

mv /opt/load.conf.tt2 /build/Chado-${BRANCH}/chado/load/tt2/load.conf.tt2
# Remove old versions in case bad things happen
rm /host/*

VERSION=$(cat Makefile.PL | grep 'my $VERSION' | sed 's/.* = //g;s/;//';)

Expand All @@ -22,7 +24,7 @@ make
make install
make load_schema
make prepdb
pg_dump -h localhost -p 5432 -U postgres --no-owner --no-acl postgres > "/host/chado-${VERSION}-no-onto.sql"
pg_dump -h localhost -p 5432 -U postgres --no-owner --no-acl postgres | gzip > "/host/chado-${VERSION}-no-onto.sql.gz"
echo "1" | make ontologies
psql -h localhost -p 5432 -U postgres -c "UPDATE cvterm SET cv_id = 7 WHERE cv_id IN (SELECT cv_id FROM cv WHERE name='ro')"

Expand All @@ -45,16 +47,9 @@ echo "select * from fill_cvtermpath('cellular_component');" | psql -h localhost
# Update links to external dbs
psql -h localhost -p 5432 -U postgres < /opt/update_urls.sql

pg_dump -h localhost -p 5432 -U postgres --no-owner --no-acl postgres > "/host/chado-${VERSION}.sql"
pg_dump -h localhost -p 5432 -U postgres --no-owner --no-acl postgres | gzip > "/host/chado-${VERSION}.sql.gz"
psql -h localhost -p 5432 -U postgres -c 'ALTER SCHEMA public RENAME TO chado'
pg_dump -h localhost -p 5432 -U postgres --no-owner --no-acl postgres > "/host/chado-${VERSION}-tripal.sql"

gzip < "/host/chado-${VERSION}-no-onto.sql" > "/host/chado-${VERSION}-no-onto.sql.gz"
gzip < "/host/chado-${VERSION}.sql" > "/host/chado-${VERSION}.sql.gz"
gzip < "/host/chado-${VERSION}-tripal.sql" > "/host/chado-${VERSION}-tripal.sql.gz"

# Remove non-gzipped versions, zero value.
rm /host/chado-${VERSION}*.sql
pg_dump -h localhost -p 5432 -U postgres --no-owner --no-acl postgres | gzip > "/host/chado-${VERSION}-tripal.sql.gz"

echo "The schema build has completed. The container will now intentionally crash"
exit 42;

0 comments on commit bcac011

Please sign in to comment.