-
Notifications
You must be signed in to change notification settings - Fork 0
/
tasks.py
47 lines (32 loc) · 968 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import glob
import os
from invoke import task
@task
def update(c):
txt_files = glob.glob("requirements/*.txt")
for file in txt_files:
os.remove(file)
in_files = glob.glob("requirements/*.in")
for file in in_files:
path, ext = file.split(".")
c.run(f"pip-compile {file} -o {path}.txt")
c.run(f"pip-compile {' '.join(in_files)} -o requirements/all.txt")
@task
def sync(c):
c.run("pip-sync requirements/all.txt")
@task
def package(c):
c.run("rm -rf dist")
c.run("cp -R source dist")
c.run("pip install -r requirements/jobs.txt -t dist")
@task
def clean(c):
c.run("rm -rf dist")
c.run("rm -rf cdk.out")
c.run("rm -rf .pytest_cache")
@task
def deploy(c):
c.run("cdk deploy HelloWorkflowStack --require-approval never")
@task
def stack_outputs(c):
c.run("aws cloudformation describe-stacks --stack-name \"HelloWorkflowStack\" --query \"Stacks[0].Outputs\" > stack-outputs.json")