Skip to content
This repository has been archived by the owner on Dec 2, 2019. It is now read-only.

Commit

Permalink
add bluepill support for launch, so that deliver works on smartOS/joy…
Browse files Browse the repository at this point in the history
…ent cloud
  • Loading branch information
Jonathan Dahan committed Jan 28, 2013
1 parent 69ccf70 commit 0ddefb0
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
36 changes: 22 additions & 14 deletions libexec/common
Expand Up @@ -137,7 +137,7 @@ rvmrc_trust() {
status "Trusting rvmrc in $DELIVER_TO"
__remote "
set -e
source .profile
source ~/.profile
rvm rvmrc trust $DELIVER_TO $SILENCE
"

Expand All @@ -151,7 +151,7 @@ authorize_remote_hosts() {
status "Authorizing remote hosts"
__remote "
set -e
source .profile
source ~/.profile
for _remote_host in $AUTHORIZED_REMOTE_HOSTS
do
if [[ \$(ssh-keygen -F \$_remote_host | grep -c found) = 0 ]]
Expand All @@ -169,7 +169,7 @@ bundle_install() {
status "Installing gems with bundler"
__remote "
set -e
source .profile
source ~/.profile
cd $DELIVER_TO $SILENCE
if [[ \$APP_ENV = production ]] || [[ \$RACK_ENV = production ]] || [[ \$RAILS_ENV = production ]]
then
Expand All @@ -188,7 +188,7 @@ npm_install() {
status "Installing modules with npm"
__remote "
set -e
source .profile
source ~/.profile
cd $DELIVER_TO $SILENCE
npm install $SILENCE
"
Expand All @@ -206,7 +206,7 @@ foreman_export() {

__remote "
set -e
source .profile
source ~/.profile
cd $DELIVER_TO $SILENCE
$_foreman $SILENCE
"
Expand All @@ -224,15 +224,23 @@ launch() {
#
# I will be tackling this shortly, you really shouldn't neeed sudo
# privileges to deliver an app. What was I thinking?!?
__remote "
set -e
if [[ \$(sudo initctl list | awk '/^'$APP' / { print \$0 }') =~ 'run' ]]; then
sudo stop $APP $SILENCE
fi
sudo rm -f /etc/init/$APP[.-]*
sudo mv -f $DELIVER_TO/tmp/*conf /etc/init/
sudo start $APP $SILENCE
" "$HOSTS"
if [[ "$SUPERVISOR" == "bluepill" ]]; then
__remote "
set -e
sudo bluepill status ${APP}-web | grep up && sudo bluepill stop ${APP}-web $SILENCE
sudo bluepill load $DELIVER_TO/tmp/${APP}.pill $SILENCE
" "$HOSTS"
else
__remote "
set -e
if [[ \$(sudo initctl list | awk '/^'$APP' / { print \$0 }') =~ 'run' ]]; then
sudo stop $APP $SILENCE
fi
sudo rm -f /etc/init/$APP[.-]*
sudo mv -f $DELIVER_TO/tmp/*conf /etc/init/
sudo start $APP $SILENCE
" "$HOSTS"
fi

__exec_if_defined "post_launch"
}
Expand Down
2 changes: 1 addition & 1 deletion strategies/nodejs
Expand Up @@ -19,5 +19,5 @@ run() {
git_submodules
npm_install
foreman_export
upstart
launch
}

0 comments on commit 0ddefb0

Please sign in to comment.