Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.81 KB | None | 0 0
  1. commands:
  2. create_post_dir:
  3. command: "mkdir /opt/elasticbeanstalk/hooks/appdeploy/post"
  4. command: "mkdir /opt/elasticbeanstalk/hooks/postinit"
  5. ignoreErrors: true
  6. files:
  7. "/opt/elasticbeanstalk/hooks/appdeploy/post/50_restart_sidekiq.sh":
  8. mode: "000755"
  9. owner: root
  10. group: root
  11. content: |
  12. #!/usr/bin/env bash
  13. source /usr/local/share/chruby/chruby.sh
  14. chruby current
  15. . /opt/elasticbeanstalk/support/envvars
  16. cd /var/app/current
  17.  
  18. if [ -f /var/app/containerfiles/pids/sidekiq.pid ]
  19. then
  20. kill -TERM `cat /var/app/containerfiles/pids/sidekiq.pid`
  21. rm -rf /var/app/containerfiles/pids/sidekiq.pid
  22. fi
  23.  
  24. . /opt/elasticbeanstalk/support/envvars.d/sysenv
  25.  
  26. sleep 10
  27. bundle exec sidekiq -e $RAILS_ENV -C /var/app/current/config/sidekiq.yml -L /var/app/containerfiles/logs/sidekiq.log -d
  28.  
  29. "/opt/elasticbeanstalk/hooks/appdeploy/pre/03_mute_sidekiq":
  30. mode: "000755"
  31. owner: root
  32. group: root
  33. ignoreErrors: true
  34. content: |
  35. #!/usr/bin/env bash
  36. cd /var/app/current
  37. source /usr/local/share/chruby/chruby.sh
  38. chruby current
  39. . /opt/elasticbeanstalk/support/envvars
  40. if [ -f /var/app/containerfiles/pids/sidekiq.pid ]
  41. then
  42. kill -USR1 `cat /var/app/containerfiles/pids/sidekiq.pid`
  43. fi
  44.  
  45. "/opt/elasticbeanstalk/hooks/restartappserver/post/50_start_sidekiq.sh":
  46. mode: "000755"
  47. owner: root
  48. group: root
  49. content: |
  50. #!/usr/bin/env bash
  51. source /user/local/share/chruby/chruby.sh
  52. chruby current
  53. . /opt/elasticbeanstalk/support/envvars
  54. cd /var/app/current
  55. if ! [ -f /var/app/containerfiles/pids/sidekiq.pid ]
  56. then
  57. bundle exec sidekiq -e $RAILS_ENV -C /var/app/current/sidekiq.yml -L /var/app/containerfiles/logs/sidekiq.log -d
  58. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement