* VRFS-438 - squirt out BUILD_NUMBER into file and make debian packages reference it when it starts the app so that gem versions can be found

This commit is contained in:
Seth Call 2013-09-16 17:03:26 +00:00
parent fbb9009fcb
commit e76fc73595
9 changed files with 14 additions and 7 deletions

1
admin/.gitignore vendored
View File

@ -19,3 +19,4 @@
artifacts
*.iml
.idea
BUILD_NUMBER

View File

@ -59,6 +59,7 @@ module JamAdmin
end
EOF
echo "$BUILD_NUMBER" > BUILD_NUMBER
type -P dpkg-architecture > /dev/null
@ -79,7 +80,7 @@ EOF
bundle exec rake assets:precompile RAILS_ENV=production
# create debian using fpm
bundle exec fpm -s dir -t deb -p target/deb/jam-admin_0.1.${BUILD_NUMBER}_${ARCH}.deb -n "jam-admin" -v "0.1.$BUILD_NUMBER" --prefix /var/lib/jam-admin --after-install $DIR/script/package/post-install.sh --before-install $DIR/script/package/pre-install.sh --before-remove $DIR/script/package/pre-uninstall.sh --after-remove $DIR/script/package/post-uninstall.sh Gemfile .bundle config Rakefile script config.ru lib public vendor app
bundle exec fpm -s dir -t deb -p target/deb/jam-admin_0.1.${BUILD_NUMBER}_${ARCH}.deb -n "jam-admin" -v "0.1.$BUILD_NUMBER" --prefix /var/lib/jam-admin --after-install $DIR/script/package/post-install.sh --before-install $DIR/script/package/pre-install.sh --before-remove $DIR/script/package/pre-uninstall.sh --after-remove $DIR/script/package/post-uninstall.sh Gemfile .bundle config Rakefile script config.ru lib public vendor app BUILD_NUMBER
fi

View File

@ -2,7 +2,7 @@
# default config values
PORT=3000
BUILD_NUMBER=1
BUILD_NUMBER=`cat /var/lib/jam-admin/BUILD_NUMBER`
CONFIG_FILE="/etc/jam-admin/upstart.conf"

1
web/.gitignore vendored
View File

@ -37,3 +37,4 @@ vendor/cache
public/assets
public/uploads
/log/*.out
BUILD_NUMBER

View File

@ -103,6 +103,7 @@ module JamWeb
end
EOF
echo "$BUILD_NUMBER" > BUILD_NUMBER
type -P dpkg-architecture > /dev/null
@ -123,7 +124,7 @@ EOF
bundle exec rake assets:precompile RAILS_ENV=production
# create debian using fpm
bundle exec fpm -s dir -t deb -p target/deb/jam-web_0.1.${BUILD_NUMBER}_${ARCH}.deb -n "jam-web" -v "0.1.$BUILD_NUMBER" --prefix /var/lib/jam-web --after-install $DIR/script/package/post-install.sh --before-install $DIR/script/package/pre-install.sh --before-remove $DIR/script/package/pre-uninstall.sh --after-remove $DIR/script/package/post-uninstall.sh Gemfile .bundle config Rakefile script config.ru lib public vendor app
bundle exec fpm -s dir -t deb -p target/deb/jam-web_0.1.${BUILD_NUMBER}_${ARCH}.deb -n "jam-web" -v "0.1.$BUILD_NUMBER" --prefix /var/lib/jam-web --after-install $DIR/script/package/post-install.sh --before-install $DIR/script/package/pre-install.sh --before-remove $DIR/script/package/pre-uninstall.sh --after-remove $DIR/script/package/post-uninstall.sh Gemfile .bundle config Rakefile script config.ru lib public vendor app BUILD_NUMBER
fi

View File

@ -2,7 +2,7 @@
# default config values
PORT=3000
BUILD_NUMBER=1
BUILD_NUMBER=`cat /var/lib/jam-web/BUILD_NUMBER`
CONFIG_FILE="/etc/jam-web/upstart.conf"

View File

@ -23,3 +23,4 @@ log/*
*.iml
target
vendor
BUILD_NUMBER

View File

@ -45,7 +45,9 @@ if [ -n "$PACKAGE" ]; then
echo "BUILD NUMBER is not defined"
exit 1
fi
echo "$BUILD_NUMBER" > BUILD_NUMBER
type -P dpkg-architecture > /dev/null
if [ "$?" = "0" ]; then
@ -60,7 +62,7 @@ if [ -n "$PACKAGE" ]; then
bundle install --path vendor/bundle --local
# create debian using fpm
bundle exec fpm -s dir -t deb -p target/deb/websocket-gateway_0.1.${BUILD_NUMBER}_${ARCH}.deb -n "websocket-gateway" -v "0.1.$BUILD_NUMBER" --prefix /var/lib/websocket-gateway --after-install $DIR/script/package/post-install.sh --before-install $DIR/script/package/pre-install.sh --before-remove $DIR/script/package/pre-uninstall.sh --after-remove $DIR/script/package/post-uninstall.sh Gemfile lib bin vendor .bundle config script
bundle exec fpm -s dir -t deb -p target/deb/websocket-gateway_0.1.${BUILD_NUMBER}_${ARCH}.deb -n "websocket-gateway" -v "0.1.$BUILD_NUMBER" --prefix /var/lib/websocket-gateway --after-install $DIR/script/package/post-install.sh --before-install $DIR/script/package/pre-install.sh --before-remove $DIR/script/package/pre-uninstall.sh --after-remove $DIR/script/package/post-uninstall.sh Gemfile lib bin vendor .bundle config script BUILD_NUMBER
fi

View File

@ -1,7 +1,7 @@
#!/bin/bash -l
# default config values
BUILD_NUMBER=1
BUILD_NUMBER=`cat /var/lib/websocket-gateway/BUILD_NUMBER`
CONFIG_FILE="/etc/websocket-gateway/upstart.conf"
if [ -e "$CONFIG_FILE" ]; then