* VRFS-188 done for now. type sudo start jam-web or sudo stop jam-web to start/stop on ubuntu

This commit is contained in:
Seth Call 2013-01-04 22:00:47 -06:00
parent aabf2d6dd1
commit 1e9d26432a
5 changed files with 18 additions and 21 deletions

14
build
View File

@ -64,6 +64,18 @@ if [ -n "$PACKAGE" ]; then
echo "BUILD NUMBER is not defined"
exit 1
fi
type -P dpkg-architecture > /dev/null
if [ "$?" = "0" ]; then
ARCH=`dpkg-architecture -qDEB_HOST_ARCH`
else
echo "WARN: unable to determine architecture."
ARCH=`all`
fi
set -e
# cache all gems local, and tell bundle to use local gems only
bundle install --path vendor/bundle --local
@ -72,7 +84,7 @@ if [ -n "$PACKAGE" ]; then
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}_amd64.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 --exclude $DIR/.git .
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 --exclude $DIR/.git .
fi

View File

@ -4,13 +4,4 @@ start on startup
start on runlevel [2345]
stop on runlevel [016]
#expect daemon
#expect fork
env BUILD_NUMBER=1
#chdir /var/lib/jam-web
#exec /usr/local/rbenv/shims/bundle exec unicorn_rails -E production -c config/unicorn.rb >> /tmp/loggie
#exec /var/lib/jam-web/script/package/upstart-run.sh
exec start-stop-daemon --start --chdir /var/lib/jam-web --exec /var/lib/jam-web/script/package/upstart-run.sh

View File

@ -1,6 +0,0 @@
#!/bin/sh
export BUILD_NUMBER=1
exec "/usr/local/rbenv/versions/1.9.3-p327/bin/ruby" "$@"

View File

@ -8,6 +8,6 @@ USER="$NAME"
GROUP="$NAME"
# copy upstart file
cp /var/lib/$NAME/script/package/jam-web.conf /etc/init/jam-web.conf
cp /var/lib/$NAME/script/package/$NAME.conf /etc/init/$NAME.conf
chown -R $USER:$GROUP /var/lib/$NAME

View File

@ -9,11 +9,11 @@ if [ "$1" = "remove" ]
then
set +e
# stop the process, if any is found. we don't want this failing to cause an error, though.
start-stop-daemon --stop -u jam-web -o --retry 5
set -e
sudo stop $NAME
set -e
if [ -f /etc/init/jam-web.conf ]; then
rm /etc/init/jam-web.conf
if [ -f /etc/init/$NAME.conf ]; then
rm /etc/init/$NAME.conf
fi
fi