Skip to content

Instantly share code, notes, and snippets.

@dginther
Created October 10, 2014 19:15
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 dginther/6de7e713251eebee08c4 to your computer and use it in GitHub Desktop.
Save dginther/6de7e713251eebee08c4 to your computer and use it in GitHub Desktop.
include:
- app.atpay
bundler:
cmd.run:
- cwd: /root
- name: /usr/local/bin/gem install bundler
install_bundle:
cmd.run:
- cwd: /var/www/atpay
- name: /usr/local/bin/bundle install
- user: ubuntu
require:
- git: git@github.com:atpay/atpay.git
- cmd: bundler
include:
- app.bundle
- app.unicorn
- core.redis
phrase_pull:
cmd.wait:
- cwd: /var/www/atpay
- user: ubuntu
- name: /usr/local/bin/phrase pull
- watch:
- cmd: install_bundle
db_migrate:
cmd.wait:
- cwd: /var/www/atpay
- user: ubuntu
- name: /usr/local/bin/bundle exec rake db:migrate
- watch:
- cmd: install_bundle
clean_and_precompile_assets:
cmd.wait:
- cwd: /var/www/atpay
- user: ubuntu
- name: /usr/local/bin/bundle exec rake assets:clean && sleep 30 && /usr/local/bin/bundle exec rake assets:precompile
- watch:
- cmd: install_bundle
- require:
- service: redis
restart_unicorn:
cmd.wait:
- user: root
- name: /etc/init.d/unicorn-hot-restart
- watch:
- cmd: clean_and_precompile_assets
require:
- file: /etc/init.d/unicorn-hot-restart
remove_v3.js:
cmd.wait:
- user: root
- name: rm -f /var/www/atpay/public/sdk/v3.js
- watch:
- cmd: restart_unicorn
workers:
service:
- running
- enable: True
- watch:
- cmd: remove_v3.js
restart_memcached:
cmd.wait:
- user: root
- name: /usr/sbin/service memcached restart
- watch:
- cmd: remove_v3.js
restart_nginx:
cmd.wait:
- user: root
- name: /usr/sbin/service nginx restart
- watch:
- cmd: restart_memcached
include:
- core.monit
/etc/unicorn:
file.directory:
- user: root
- group: root
- dir_mode: 755
- file_mode: 660
- makedirs: True
- recurse:
- user
- group
- mode
/etc/init.d/unicorn:
file.managed:
- source: salt://app/unicorn/unicorn
- template: jinja
- user: root
- group: root
- mode: 755
/etc/init.d/unicorn-hot-restart:
file.managed:
- source: salt://app/unicorn/unicorn-hot-restart
- template: jinja
- user: root
- group: root
- mode: 755
/etc/monit/conf.d/unicorn.monit:
file.managed:
- source: salt://app/unicorn/unicorn.monit
- template: jinja
- user: root
- group: root
- mode: 644
- watch_in:
- service: monit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment