-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
fabfile.py
56 lines (47 loc) · 1.7 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
from tools.fablib import *
from fabric.api import task
"""
Getting set up for the first time and using vim?
Run:
:%s/mstoday/project_name/g # name for the project, used as the database name. This should match the umbrella repository name and the domain.wpengine.com name
:%s/MSTODAY/YOUR_SITE_ENV_VAR/g # environment variable slug from INN's secrets repository
"""
"""
Base configuration
"""
env.project_name = 'mstoday'
env.hosts = ['localhost', ]
env.sftp_deploy = True # needed for wpengine
env.domain = 'mstoday.dev'
"""
Add HipChat info to send a message to a room when new code has been deployed.
"""
env.hipchat_token = ''
env.hipchat_room_id = ''
# Environments
@task
def production():
"""
Work on production environment
"""
env.settings = 'production'
env.hosts = [ os.environ[ 'MSTODAY_PRODUCTION_SFTP_HOST' ], ] # ssh host for production.
env.user = os.environ[ 'MSTODAY_PRODUCTION_SFTP_USER' ] # ssh user for production.
env.password = os.environ[ 'MSTODAY_PRODUCTION_SFTP_PASSWORD' ] # ssh password for production.
env.domain = 'mstoday.wpengine.com'
env.port = '2222'
@task
def staging():
"""
Work on staging environment
"""
env.settings = 'staging'
env.hosts = [ os.environ[ 'MSTODAY_STAGING_SFTP_HOST' ], ] # ssh host for production.
env.user = os.environ[ 'MSTODAY_STAGING_SFTP_USER' ] # ssh user for production.
env.password = os.environ[ 'MSTODAY_STAGING_SFTP_PASSWORD' ] # ssh password for production.
env.domain = 'mstoday.staging.wpengine.com'
env.port = '2222'
try:
from local_fabfile import *
except ImportError:
pass