Commit 21d6bc98 by YSC

add ecommerce template files

parent 039599ee
#!/usr/bin/env bash
# {{ ansible_managed }}
{% set ecommerce_venv_bin = ecommerce_home + "/venvs/" + ecommerce_service_name + "/bin" %}
{% if COMMON_ENABLE_NEWRELIC_APP %}
{% set executable = ecommerce_venv_bin + '/newrelic-admin run-program ' + ecommerce_venv_bin + '/gunicorn' %}
{% else %}
{% set executable = ecommerce_venv_bin + '/gunicorn' %}
{% endif %}
{% if COMMON_ENABLE_NEWRELIC_APP %}
export NEW_RELIC_APP_NAME="{{ ECOMMERCE_NEWRELIC_APPNAME }}"
export NEW_RELIC_LICENSE_KEY="{{ NEWRELIC_LICENSE_KEY }}"
{% endif -%}
source {{ ecommerce_home }}/ecommerce_env
{{ executable }} -c {{ ecommerce_home }}/ecommerce_gunicorn.py {{ ECOMMERCE_GUNICORN_EXTRA }} ecommerce.wsgi:application
# {{ ansible_managed }}
{% for name,value in ecommerce_environment.items() -%}
{%- if value -%}
export {{ name }}="{{ value }}"
{% endif %}
{%- endfor %}
"""
gunicorn configuration file: http://docs.gunicorn.org/en/develop/configure.html
{{ ansible_managed }}
"""
timeout = {{ ecommerce_gunicorn_timeout }}
bind = "{{ ecommerce_gunicorn_host }}:{{ ecommerce_gunicorn_port }}"
pythonpath = "{{ ecommerce_code_dir }}"
workers = {{ ECOMMERCE_GUNICORN_WORKERS }}
worker_class = "{{ ECOMMERCE_GUNICORN_WORKER_CLASS }}"
{% if ECOMMERCE_GUNICORN_MAX_REQUESTS %}
max_requests = {{ ECOMMERCE_GUNICORN_MAX_REQUESTS }}
{% endif %}
{{ ECOMMERCE_GUNICORN_EXTRA_CONF }}
#
# {{ ansible_managed }}
#
[program:{{ ecommerce_service_name }}]
command={{ ecommerce_home }}/{{ ecommerce_service_name }}.sh
user={{ common_web_user }}
directory={{ ecommerce_code_dir }}
stdout_logfile={{ supervisor_log_dir }}/%(program_name)s-stdout.log
stderr_logfile={{ supervisor_log_dir }}/%(program_name)s-stderr.log
killasgroup=true
stopasgroup=true
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment