Skip to content

Instantly share code, notes, and snippets.

@panchicore
Created March 24, 2016 12:06
Show Gist options
  • Save panchicore/26e56cca53e6c325a3bf to your computer and use it in GitHub Desktop.
Save panchicore/26e56cca53e6c325a3bf to your computer and use it in GitHub Desktop.
pull when server starts. I use it when I run multiples intances, this is located in the supervisord config file of the AMI
#!/bin/bash
sleep 20 && cd /home/ubuntu/www/aquehorajuega.co/aquehorajuega && /usr/bin/git pull origin master && sudo supervisorctl restart aqhj
[program:aqhj]
....
[program:pull]
command=sh /home/ubuntu/pull.sh
user=ubuntu
autostart=true # run on supervisord startup
autorestart=false # but once on supervisord startup
stdout_logfile=/home/ubuntu/www/aquehorajuega.co/logs/pull.log
redirect_stderr=true
environment=HOME=/home/ubuntu,USER=ubuntu
priority=10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment