Skip to content

Instantly share code, notes, and snippets.

@rishiag
Last active August 29, 2015 14:16
Show Gist options
  • Save rishiag/22e9613d94f42a926314 to your computer and use it in GitHub Desktop.
Save rishiag/22e9613d94f42a926314 to your computer and use it in GitHub Desktop.
cd code-repo
git pull origin master
rm ~/build-dir/code-repo.tar.gz
meteor build ~/build-dir/
cd ~/build-dir
value=`cat fileCheck`
if [ "$value" = "old" ]; then
rm -rf ~/build-dir/new
mkdir ~/build-dir/new
tar xzvf code-repo.tar.gz -C ~/build-dir/new
cd ~/build-dir/new/bundle
(cd programs/server && npm install)
forever stop all
PORT=3000 MONGO_URL="some_url" ROOT_URL=some_url forever start main.js
echo "new" > fileCheck
else
rm -rf ~/build-dir/old
mkdir ~/build-dir/old
tar xzvf code-repo.tar.gz -C ~/build-dir/old
cd ~/build-dir/old/bundle
(cd programs/server && npm install)
forever stop all
PORT=3000 MONGO_URL="some_url" ROOT_URL=some_url forever start main.js
echo "old" > fileCheck
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment