Skip to content

Commit

Permalink
Merge pull request #480 from bgruening/feature/add_postgres_dump_to_b…
Browse files Browse the repository at this point in the history
…uild

Run dumpsql within build-orchestration-images
  • Loading branch information
bgruening authored Feb 7, 2019
2 parents 6d296f5 + 06d2bfb commit c801cbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions compose/build-orchestration-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ GALAXY_BASE_TAG=$DOCKER_REPO$DOCKER_USER/galaxy-base:$TAG
GALAXY_INIT_TAG=$DOCKER_REPO$DOCKER_USER/galaxy-init:$TAG
GALAXY_WEB_TAG=${OVERRIDE_GALAXY_WEB_TAG:-$DOCKER_REPO$DOCKER_USER/galaxy-web:$TAG}

# Set postgres tag
if [[ -n "${OVERRIDE_POSTGRES_TAG:-}" ]]; then
POSTGRES_TAG="${OVERRIDE_POSTGRES_TAG}"
else
Expand Down Expand Up @@ -227,6 +228,10 @@ if $DOCKER_PUSH_ENABLED; then
docker push $GALAXY_WEB_TAG
fi

# Create dump for postgres based on init created here
export GALAXY_INIT_TAG
./dumpsql.sh

# Build postgres
docker build -t $POSTGRES_TAG -f galaxy-postgres/Dockerfile galaxy-postgres/
if $DOCKER_PUSH_ENABLED; then
Expand Down
4 changes: 2 additions & 2 deletions compose/dumpsql.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

TAG=v18.09
INIT_IMAGE=${GALAXY_INIT_TAG:-"quay.io/bgruening/galaxy-init:v18.09"}

# Sets the image of postgres to use
POSTGRES=postgres:9.6.5
Expand All @@ -26,7 +26,7 @@ init_start=`date +%s`
docker run -i --rm --name "dumpsql_galaxy_installdb" \
-e "GALAXY_CONFIG_FILE=/etc/galaxy/galaxy.yml" \
-e "GALAXY_CONFIG_DATABASE_CONNECTION=postgresql://$POSTGRES_USER:$POSTGRES_PASSWORD@db/$POSTGRES_DB?client_encoding=utf8" \
--link "dumpsql_postgres:db" quay.io/bgruening/galaxy-init:$TAG install_db.sh
--link "dumpsql_postgres:db" $INIT_IMAGE install_db.sh

init_end=`date +%s`
dump_start=`date +%s`
Expand Down

0 comments on commit c801cbd

Please sign in to comment.