-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathfabfile.py
90 lines (85 loc) · 3.99 KB
/
fabfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from os.path import join
from fabric.api import env, task
from fagungis.tasks import *
@task
def LQCharacter():
# name of your project - no spaces, no special chars
env.project = 'LQCharacter'
# hg repository of your project
env.repository = '[email protected]:CoinLQ/LQCharacter.git'
# hosts to deploy your project, users must be sudoers
env.hosts = ['[email protected]', ]
# additional packages to be installed on the server
env.additional_packages = [
'git',
]
# system user, owner of the processes and code on your server
# the user and it's home dir will be created if not present
env.django_user = 'django'
# user group
env.django_user_group = env.django_user
# the code of your project will be located here
env.django_user_home = join('/opt', env.django_user)
# projects path
env.projects_path = join(env.django_user_home, 'projects')
# the root path of your project
env.code_root = join(env.projects_path, env.project)
# the path where manage.py of this project is located
env.django_project_root = env.code_root
# the Python path to a Django settings module.
env.django_project_settings = 'settings'
# django media dir
env.django_media_path = '/www/lqhansp/media'
# django static dir
env.django_static_path = '/www/lqhansp/static'
# django media url and root dir
env.django_media_url = '/media/'
env.django_media_root = env.django_media_path
# django static url and root dir
env.django_static_url = '/static/'
# env.django_static_root = env.code_root
env.django_static_root = env.django_static_path
# do you use south in your django project?
env.south_used = True
# virtualenv root
env.virtenv = join(env.django_user_home, 'envs', env.project)
# some virtualenv options, must have at least one
env.virtenv_options = ['distribute', 'no-site-packages', ]
# location of your pip requirements file
# http://www.pip-installer.org/en/latest/requirements.html#the-requirements-file-format
# set it to None to not use
env.requirements_file = join(env.code_root, 'requirements.txt')
# always ask user for confirmation when run any tasks
env.ask_confirmation = False
# START gunicorn settings ###
# be sure to not have anything running on that port
env.gunicorn_bind = "127.0.0.1:8100"
env.gunicorn_logfile = '%(django_user_home)s/logs/projects/%(project)s_gunicorn.log' % env
env.rungunicorn_script = '%(django_user_home)s/scripts/rungunicorn_%(project)s.sh' % env
env.gunicorn_workers = 2
env.gunicorn_worker_class = "eventlet"
env.gunicorn_loglevel = "info"
# END gunicorn settings ###
# START nginx settings ###
env.nginx_server_name = 'lqcharacter.dzj3000.com' # Only domain name, without 'www' or 'http://'
env.nginx_conf_file = '%(django_user_home)s/configs/nginx/%(project)s.conf' % env
env.nginx_client_max_body_size = 10 # Maximum accepted body size of client request, in MB
env.nginx_htdocs = '%(django_user_home)s/htdocs' % env
# will configure nginx with ssl on, your certificate must be installed
# more info here: http://wiki.nginx.org/HttpSslModule
env.nginx_https = False
# END nginx settings ###
# START supervisor settings ###
# http://supervisord.org/configuration.html#program-x-section-settings
# default: env.project
env.supervisor_program_name = env.project
env.supervisorctl = '/usr/bin/supervisorctl' # supervisorctl script
env.supervisor_autostart = 'true' # true or false
env.supervisor_autorestart = 'true' # true or false
env.supervisor_redirect_stderr = 'true' # true or false
env.supervisor_stdout_logfile = '%(django_user_home)s/logs/projects/supervisord_%(project)s.log' % env
env.supervisord_conf_file = '%(django_user_home)s/configs/supervisord/%(project)s.conf' % env
# END supervisor settings ###
env.supervisor_celery_worker_name = 'celery'