#!/bin/bash -l TARGET=target PG_BUILD_OUT=$TARGET/build PG_RUBY_PACKAGE_OUT=$TARGET/ruby_package PROJECT_NAME="jam_db" if [ -z $BUILD_NUMBER ]; then BUILD_NUMBER="0.0.${BUILD_NUMBER}" fi set -e # remove the output directory rm -rf $TARGET mkdir -p $PG_BUILD_OUT mkdir -p $PG_RUBY_PACKAGE_OUT bundle update echo "building migrations" bundle exec pg_migrate build --source . --out $PG_BUILD_OUT --test --verbose echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "$BUILD_NUMBER" bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $BUILD_NUMBER