-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
65 lines (64 loc) · 1.79 KB
/
Taskfile.yml
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
version: '3'
#output: prefixed
vars:
config: # without .json
REGION:
sh: echo $AWS_REGION
CDK_DEFAULT_ACCOUNT:
sh: aws sts get-caller-identity |jq -r .
tasks:
deploy:
desc: Deploy Stack
cmds:
- task: clean
- task: cdkdeploy
synth:
desc: synth Stack
cmds:
- task: clean
- cdk synth
vars:
ACCOUNT:
sh: aws sts get-caller-identity |jq -r .Account
TAGS:
sh: cat tags/tags.json | jq -j '.[]|"--tags " + (.Key)+"="+(.Value)+" "'
env:
PROCESS_PARAMETERS: values/{{.config}}.json
clean:
desc: Clean CDK Out
cmds:
- rm -rf ./cdk.out
- rm -rf ./node-modules
silent: true
cdkdiff:
desc: CDK Diff
cmds:
- if [[ {{.CDK_DIFF}} = true ]];then cdk diff; echo -n "Continue (y/n)?"; read CONT; if [ "$CONT" = "n" ]; then echo "NO" | exit 1; else echo "YES"; fi; else exit 0;fi;
silent: true
interactive: true
env:
PROCESS_PARAMETERS: values/{{.config}}.json
preconditions:
- sh: "test {{.config}}"
msg: "config Variable was not set"
- sh: "test -f values/{{.config}}.json"
msg: "Values file not found: values/{{.config}}.json"
cdkdeploy:
desc: CDK Deploy
cmds:
- cdk deploy --require-approval never {{.TAGS}}
- rm -f $(find ./cdk.out/*assets.json -type f)
vars:
ACCOUNT:
sh: aws sts get-caller-identity |jq -r .Account
TAGS:
sh: cat tags/tags.json | jq -j '.[]|"--tags " + (.Key)+"="+(.Value)+" "'
preconditions:
- sh: "test {{.config}}"
msg: "config Variable was not set"
- sh: "test -f values/{{.config}}.json"
msg: "Values file not found: values/{{.config}}.json"
env:
PROCESS_PARAMETERS: values/{{.config}}.json
silent: true
interactive: true