2012-10-30 12:26:40 +00:00
|
|
|
#!/bin/bash -l
|
2012-07-29 17:36:02 +00:00
|
|
|
|
|
|
|
|
TARGET=target
|
|
|
|
|
PG_BUILD_OUT=$TARGET/build
|
|
|
|
|
PG_RUBY_PACKAGE_OUT=$TARGET/ruby_package
|
|
|
|
|
PROJECT_NAME="jam_db"
|
|
|
|
|
|
|
|
|
|
if [ -z $BUILD_NUMBER ]; then
|
2012-11-02 06:51:40 +00:00
|
|
|
BUILD_NUMBER="1"
|
2012-07-29 17:36:02 +00:00
|
|
|
fi
|
|
|
|
|
|
2013-09-18 20:14:37 +00:00
|
|
|
VERSION="0.1.${BUILD_NUMBER}"
|
2012-07-29 17:36:02 +00:00
|
|
|
|
|
|
|
|
set -e
|
|
|
|
|
|
|
|
|
|
# remove the output directory
|
|
|
|
|
rm -rf $TARGET
|
|
|
|
|
|
|
|
|
|
mkdir -p $PG_BUILD_OUT
|
|
|
|
|
mkdir -p $PG_RUBY_PACKAGE_OUT
|
|
|
|
|
|
2014-02-02 20:03:31 +00:00
|
|
|
bundle install --path vendor/bundle
|
2012-07-29 17:36:02 +00:00
|
|
|
|
|
|
|
|
echo "building migrations"
|
2012-10-03 03:46:28 +00:00
|
|
|
bundle exec pg_migrate build --source . --out $PG_BUILD_OUT --test --verbose
|
2012-07-29 17:36:02 +00:00
|
|
|
|
2012-11-02 06:51:40 +00:00
|
|
|
echo "packaging migrations for ruby"bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name jam-db --version "$VERSION"
|
|
|
|
|
bundle exec pg_migrate package --source $PG_BUILD_OUT --out $PG_RUBY_PACKAGE_OUT --name $PROJECT_NAME --version $VERSION
|
2013-01-22 02:36:24 +00:00
|
|
|
|
2013-01-27 01:23:26 +00:00
|
|
|
if [ ! -z "$PACKAGE" ]; then
|
2013-01-22 02:36:24 +00:00
|
|
|
bundle install --path target/vendor/bundle
|
|
|
|
|
pushd target
|
|
|
|
|
fpm -s gem -t deb ruby_package/jam_db-$VERSION.gem
|
2015-07-15 16:25:58 +00:00
|
|
|
find vendor/bundle/ruby/2.2.0/cache -name '*.gem' | xargs -rn1 fpm -s gem -t deb
|
2013-07-22 15:18:23 +00:00
|
|
|
find vendor/bundle/ruby/2.0.0/cache -name '*.gem' | xargs -rn1 fpm -s gem -t deb
|
2013-01-22 02:36:24 +00:00
|
|
|
popd
|
|
|
|
|
fi
|