Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update version to 1.0.2: Add option to provide path for settings file #12

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.1
1.0.2
5 changes: 3 additions & 2 deletions docker/build-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ set -e
# default values if not set
: ${DBCONFIG_PATH:=aerius-database-build-config/config}
: ${DBRUNSCRIPT:=default}
: ${DBSETTINGS_PATH:=settings.rb}
: ${DBDATA_CLEANUP:=true} # A reason not to clean it up would be to cache the files using buildkit

# If the source code isn't made available by the extending Dockerfile we need to use git to check it out
Expand Down Expand Up @@ -59,7 +60,7 @@ echo "\$sftp_data_readonly_password = '${SFTP_READONLY_PASSWORD}'" >> "${DBCONFI
# sync db-data files we need
echo 'Syncing database data files..'
cd "${DBSOURCE_PATH}/"
ruby /aerius-database-build/bin/SyncDBData.rb settings.rb --from-sftp --to-local
ruby /aerius-database-build/bin/SyncDBData.rb "${DBSETTINGS_PATH}" --from-sftp --to-local

# initialize database
# (this is a wrapper provided by the postgres image, which will initialize the db if it isn't already and is executed when starting the image for the first time.
Expand All @@ -78,7 +79,7 @@ while [[ ! -S /var/run/postgresql/.s.PGSQL.5432 ]]; do
done

# execute database build
ruby /aerius-database-build/bin/Build.rb "${DBRUNSCRIPT}" settings.rb -v "${DATABASE_VERSION}" -n "${DATABASE_NAME}"
ruby /aerius-database-build/bin/Build.rb "${DBRUNSCRIPT}" "${DBSETTINGS_PATH}" -v "${DATABASE_VERSION}" -n "${DATABASE_NAME}"

# make the image smaller by doing a VACUUM FULL ANALYZE
psql -U "${POSTGRES_USER}" -d "${DATABASE_NAME}" -c 'VACUUM FULL ANALYZE'
Expand Down