forked from python/pythondotorg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.py
28 lines (23 loc) · 782 Bytes
/
tasks.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
import invoke
env = {
'host': 'virt-l4es2w.psf.osuosl.org',
'python': '/srv/redesign.python.org/shared/env/bin/python',
'deploydir': '/srv/redesign.python.org/current',
}
def run(cmd, **kwargs):
"""
Wrapper around invoke.run to automatically interpolate env.
"""
return invoke.run(cmd.format(**dict(env, **kwargs)))
@invoke.task
def chef():
run('ssh {host} sudo chef-client')
@invoke.task
def django(c):
run('ssh {host} sudo {python} {deploydir}/manage.py {c} --settings pydotorg.settings.staging', c=c)
@invoke.task
def copy_data_from_staging(keep=False):
run('curl -s -o staging.json https://preview.python.org/__secret/devfixture/')
run('python manage.py loaddata staging.json')
if not keep:
run('rm -f staging.json')