This repository has been archived by the owner on Jun 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenvs.py
81 lines (63 loc) · 2.03 KB
/
envs.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
"""
Deployment environments
"""
from fabric.api import env, task
def make_basic_conf(hostname):
"Add the basic env values for our server"
env.hosts = [hostname]
env.project_path = '/usr/local/projects/{}'.format(hostname)
env.python = '/usr/bin/python3'
env.node_bin = '/usr/bin/node'
env.uwsgi_bin = '/usr/sbin/uwsgi'
env.uwsgi_conf_file = '/etc/uwsgi.d/{}.ini'.format(hostname)
env.uwsgi_uid = 'ryanshaw'
env.uwsgi_gid = 'ryanshaw'
env.uwsgi_service_uid = 'ryanshaw'
env.uwsgi_service_gid = 'ryanshaw'
env.uwsgi_socket_location = '/run/uwsgi/{}.sock'.format(hostname)
env.uwsgi_socket_uid = 'nginx'
env.uwsgi_socket_gid = 'nginx'
env.uwsgi_socket_chmod = 644
env.nginx_conf_file = '/etc/nginx/conf.d/{}.conf'.format(hostname)
env.ssl_conf_file = '/usr/local/projects/workingnotes_ssl.conf'
@task
def working_notes_test():
"Use the main Working Notes host."
hostname = 'test.workingnotes.org'
make_basic_conf(hostname)
env.renderer_port = 15023
env.markup_renderer_port = 15024
@task
def working_notes():
"Use the testing Working Notes host."
hostname = 'workingnotes.org'
make_basic_conf(hostname)
env.renderer_port = 15025
env.markup_renderer_port = 15026
@task
def beta():
"Use the beta-testing webserver."
env.name = 'beta.editorsnotes.org'
env.hosts = ['beta.editorsnotes.org']
env.project_path = '/db/projects/{project_name}-beta'.format(**env)
env.vhosts_path = '/etc/httpd/sites.d'
env.python = '/usr/bin/python2.7'
@task
def pro():
"Use the production webserver."
env.hosts = ['editorsnotes.org']
env.project_path = '/db/projects/{project_name}'.format(**env)
env.vhosts_path = '/etc/httpd/sites.d'
env.python = '/usr/bin/python2.7'
try:
from fabfile_local import *
except ImportError:
pass
# Create custom environments in fabfile_local.py, in the same style as above
ENVS = [
beta,
pro,
working_notes,
working_notes_test,
'Custom host defined in fabfile_local.py'
]