def configure_services():
""" Updates the services' init files (e.g. for gunicorn)
"""
require('code_dir')
# Ensure at-least the default gunicorn.py exists
with cd(env.code_dir + '/{{ cookiecutter.repo_name }}/settings'):
if not files.exists('gunicorn.py', use_sudo=True):
sudo('cp gunicorn.py.example gunicorn.py')
# Note: DAEMON_TYPE AND DAEMON_FILE_EXTENSION are replaced by hammer automatically
source_dir = os.path.join(
env.code_dir,
'deploy',
'${DAEMON_TYPE}',
'${SERVICE_NAME}.${DAEMON_FILE_EXTENSION}',
)
# Install the services using hammer
install_services_cp([
('gunicorn-{{cookiecutter.repo_name}}', source_dir.replace('${SERVICE_NAME}', 'gunicorn')),
])
评论列表
文章目录