Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jcigar@dev:/usr/local/etc/salt/states/webapps/files/ > more supervise.jinja
- #!/bin/sh
- {% if cfg.venv.lang == 'ruby' -%}
- exec setuidgid {{ cfg.user }} \
- /bin/sh -c '
- {% block export -%}
- export RBENV_ROOT="{{ cfg.venv.full_path }}"
- {% if 'rails' in cfg.use -%}
- export RAILS_ENV="{{ cfg.deploy.env }}"
- {%- endif %}
- {%- endblock %}
- eval "$(rbenv init -)"
- rbenv shell {{ cfg.venv.ruby_version }}
- cd {{ cfg.repo.clone_dir }}
- {%- if cfg.deploy.env == 'production' %}
- bundle exec
- {%- endif -%}
- {% if 'unicorn' in cfg.use -%}
- {{ cfg.unicorn.bin }} -E {{ cfg.deploy.env }} -c {{ cfg.unicorn_config._fullpath }} --path {{ cfg.deploy.prefix }}
- {%- elif 'thin' in cfg.use -%}
- {{ cfg.thin.bin }} -c {{ cfg.repo.clone_dir }} -a {{ cfg.deploy.host }} -e {{ cfg.deploy.env }} -p {{ cfg.deploy.port }} --prefix {{ cfg.deploy.prefix }} start
- {%- endif %}'
- {% elif cfg.venv.lang == 'python' -%}
- cd {{ cfg.repo.clone_dir }}
- exec setuidgid {{ cfg.user }} \
- {% if 'pylons' in cfg.use -%}
- /bin/sh -c ". {{ cfg.venv.activate }} && {{ cfg.pylons.bin }} {{ cfg.paste_deploy._fullpath }}"
- {% elif 'pyramid' in cfg.use -%}
- /bin/sh -c ". {{ cfg.venv.activate }} && {{ cfg.pyramid.bin }} {{ cfg.paste_deploy._fullpath }}"
- {% elif 'django' and 'gunicorn' in cfg.use -%}
- /bin/sh -c '. {{ cfg.venv.activate }} && {{ cfg.gunicorn.bin }} -b "{{ cfg.deploy.host }}:{{ cfg.deploy.port }}" --error-logfile "{{ cfg.gunicorn.error_log_file }}" -k {{ cfg.gunicorn.worker_class }} --max-requests 10000 --threads {{ cfg.deploy.threads }} --workers {{ cfg.deploy.proc }} --chdir "{{ cfg.repo.clone_dir }}" --backlog {{ cfg.deploy.backlog }} {% for ek, ev in cfg.deploy.env_vars.items() %}-e {{ ek }}="{{ ev }}" {% endfor -%} {{ cfg.django.config.app_module }}'
- {%- endif %}
- {%- endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement