This repository has been archived by the owner on Jan 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
default_fabfile.py
77 lines (61 loc) · 2.97 KB
/
default_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
from fabric_helpers import *
from fabric_helpers.machines import Machines
from fabric_helpers.machines.ubuntu import UbuntuServer
from fabric_helpers.servers.db import PostgresqlServer
from fabric_helpers.servers.web import NginxServer, ApacheServer
from fabric_helpers.servers.queue import RabbitServer, CeleryServer
# A "Machine" is a representation of an actual system the 'physical server'
# A "Server" is a representation of a specific server software to be installed
# on the Machine. Things like Postgres, Apache, etc.
# The user on the machine, this should be a generic user (ie not a real
# individual) or a user that is specific to this project.
USER = 'PROJECT_USER'
# The default Postgres sever configuration
POSTGRES = PostgresqlServer()
# The default Apache and nginx server configuration with a site called
# "django_site" this is used for setting the conf files and enabling the site.
APACHE = ApacheServer(sites=['django_site'])
NGINX = NginxServer(sites=['django_site'])
# Registering individual machines
# This is the default setup for a single machine with nginx proxying to apache
# with a postgres DB backend.
# Update the IP/Hostname to match your server
MACHINES = Machines([
Machine('SERVER IP OR HOSTNAME HERE',
ENVIRONMENTS['production'],
servers=[POSTGRES, APACHE, NGINX],
open_ports=[80, 443], # http, ssl, ssh
),
# Uncomment the following lines for a matching staging server
# Machine('SERVER IP OR HOSTNAME HERE', ENVIRONMENTS['staging'],
# short_name="prod", servers=[POSTGRES, APACHE, NGINX]),
])
# This will be the folder that all of the project files are kept in.
env.project_name = 'PROJECT NAME'
# The name and location of your project folder. By default it's set to:
# /home/USERNAME/PROJECTNAME
env.project_root = os.path.join('/home/', USER, env.project_name)
# The name of the actual project folder within the project_root defined above
# Can leave as none if you the project isn't in a subfolder. This is the
# folder that holds the settings.py and other standard project files
env.project_folder_name = None
# The path to your git repo ie:
# env.git_repo = 'git://github.com/punteney/fab_helpers.git'
env.git_repo = 'THE PATH TO YOU GIT REPO'
# The git branch to push.
# By default it will push the currently checked out branch, but you can
# uncomment below to have it push a specific branch even if that isn't
# currently checked out.
# env.git_branch = 'master'
# If you only want a specific branch to be able to be pushed to production
# specify that here. This can be used as a safety net to make sure a dev
# branch isn't accidently pushed to production
# env.git_production_branch = 'production'
# The settings below here shouldn't need to be changed
env.user = USER
env.MACHINES = MACHINES
# Currently not used
# from project.settings.production import DATABASE_NAME, DATABASE_USER, DATABASE_PASSWORD
#env.DATABASE_NAME = DATABASE_NAME
#env.DATABASE_USER = DATABASE_USER
#env.DATABASE_PASSWORD = DATABASE_PASSWORD