Skip to content

Instantly share code, notes, and snippets.

@rudylacrete
Created August 18, 2016 18:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rudylacrete/cf0cda735c735e83cda3cca6f6f57b7f to your computer and use it in GitHub Desktop.
Save rudylacrete/cf0cda735c735e83cda3cca6f6f57b7f to your computer and use it in GitHub Desktop.
Custom meteor application deployment script
#!/bin/bash
dst=/path/to/nodejs/dir
buildDir=result-cyclo-meteor
archiveName=test.tar.gz
remoteForeverProcessId=24
echo "Creating build"
meteor build ..
echo "OK"
echo "Uploading build"
scp ../$archiveName server-perso:$dst
echo "OK"
echo "Deploying build"
ssh vps-perso bash -c "'
cd $dst
forever stop $remoteForeverProcessId
rm -rf $buildDir.old
mv $buildDir $buildDir.old
mkdir $buildDir
tar xzf $archiveName -C $buildDir
cp $buildDir.old/start-meteor.backup.sh $buildDir/
cd $buildDir/bundle/programs/server/
npm install
cd npm/npm-bcrypt
rm -rf node_modules/bcrypt
npm install bcrypt
cd $dst$buildDir
sh start-meteor.backup.sh
'"
echo "OK"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment