Skip to content

Instantly share code, notes, and snippets.

@davidworkman9
Last active September 22, 2018 17:15
Show Gist options
  • Save davidworkman9/6466734 to your computer and use it in GitHub Desktop.
Save davidworkman9/6466734 to your computer and use it in GitHub Desktop.
start on runlevel [2345]
stop on runlevel [06]
respawn
respawn limit 10 5
script
APP_DIR=/var/www/bundle
LOG_FILE=/var/log/meteorApp.log
export PORT=80
export MONGO_URL=mongodb://localhost:27001/meteor # replace with your mongo database
export ROOT_URL=http://#yourdomainhere
node $APP_DIR/main.js 2>&1 >> $LOG_FILE
end script
notify-send 'Update Started'
ssh -i ~/.ssh/yourSSHKey.pem [email protected] << 'ENDSSH'
~/updateApp.sh
ENDSSH
notify-send 'Meteor App Updated'
cd /var/www/ #insert your git repo location here
git pull
meteor bundle app.tgz
mv app.tgz ../
rm -r bundle/
tar -xzf app.tgz
rm app.tgz
#restart the service
sudo service meteorApp stop
sudo service meteorApp start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment