-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtasks.py
More file actions
57 lines (46 loc) · 1.67 KB
/
tasks.py
File metadata and controls
57 lines (46 loc) · 1.67 KB
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
import os.path
from invoke import task, run
AUXDIR = './auxiliary/'
TEST_CONFIG = './auxiliary/test.conf'
TEST_DB = './auxiliary/test-database.sqlite'
@task
def gencert(ctx):
"""
Generate the certificate to serve the app from localhost.
"""
run('python3 -m wiki_monkey.gencert --path {}'.format(AUXDIR),
# http://www.pyinvoke.org/faq.html#calling-python-or-python-scripts-prints-all-the-output-at-the-end-of-the-run
pty=True)
@task
def init(ctx):
"""
Initialize the development environment.
"""
run('python3 -m wiki_monkey.aux --init-env --db-path {}'.format(TEST_DB),
# http://www.pyinvoke.org/faq.html#calling-python-or-python-scripts-prints-all-the-output-at-the-end-of-the-run
pty=True)
@task
def revise(ctx):
"""
Create an empty database-migration revision script.
"""
run('python3 -m wiki_monkey.aux --revise --db-path {}'.format(TEST_DB),
# http://www.pyinvoke.org/faq.html#calling-python-or-python-scripts-prints-all-the-output-at-the-end-of-the-run
pty=True)
@task
def migrate(ctx):
"""
Create an automatic database-migration revision script.
"""
run('python3 -m wiki_monkey.aux --migrate --db-path {}'.format(TEST_DB),
# http://www.pyinvoke.org/faq.html#calling-python-or-python-scripts-prints-all-the-output-at-the-end-of-the-run
pty=True)
@task
def serve(ctx):
"""
Serve the database on localhost.
"""
run('python3 -m wiki_monkey.main --conf {} --db-path {} --debug'.format(
TEST_CONFIG, TEST_DB),
# http://www.pyinvoke.org/faq.html#calling-python-or-python-scripts-prints-all-the-output-at-the-end-of-the-run
pty=True)