Skip to content

Instantly share code, notes, and snippets.

@superp
Created January 17, 2014 12:14
Show Gist options
  • Save superp/8472479 to your computer and use it in GitHub Desktop.
Save superp/8472479 to your computer and use it in GitHub Desktop.
Update cms gem in all projects
#!/bin/bash
# Settings
APP_ROOT="/Volumes/Data/superp/www/fodojo/writers_cms/"
PULSAR_ROOT="/Volumes/Data/superp/www/fodojo/pulsar"
APPS=(...)
APPS_COUNT=${#APPS[*]}
BUNDLE_CMD="bundle update writers_cms"
GIT_COMMIT_CMD="git commit -am 'update-cms'"
GIT_PUSH_CMD='git push origin master'
PULSAR_CMD="pulsar -l debug app_name production app:deploy"
Bundle () {
for (( i=0; i<APPS_COUNT; i++ ))
do
echo ${APPS[$i]}
path=$APP_ROOT${APPS[$i]}
cd $path
($BUNDLE_CMD; $GIT_COMMIT_CMD; $GIT_PUSH_CMD)
done
}
Pulsar () {
cd $PULSAR_ROOT
for (( i=0; i<APPS_COUNT; i++ ))
do
echo ${APPS[$i]}
${PULSAR_CMD/app_name/${APPS[$i]}}
done
}
echo "Begin updating wia bundle"
Bundle
echo "Begin deploing wia pulsar"
Pulsar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment