-
Notifications
You must be signed in to change notification settings - Fork 1
/
Taskfile.yml
68 lines (68 loc) · 1.73 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
66
67
68
version: '3'
#output: prefixed
vars:
account:
sh: aws sts get-caller-identity |jq -r .Account
tags:
sh: cat tags/tags.json | jq -j '.[]|"--tags " + (.Key)+"="+(.Value)+" "'
tasks:
deploy:
desc: Deploy Stack
cmds:
- task: clean
- task: setvariable
- cdk deploy --all --require-approval never {{.tags}}
synth:
desc: synth Stack
cmds:
- task: clean
- task: setvariable
- cdk synth
diff:
desc: synth Stack
cmds:
- task: clean
- task: setvariable
- cdk diff
destroy:
desc: synth Stack
cmds:
- task: clean
- task: setvariable
- cdk destroy
clean:
desc: Clean CDK Out
cmds:
- rm -rf ./cdk.out
- rm -rf ./node-modules
silent: true
setvariable:
desc: Unset / Set Parameters Variable
deps: [check_requirements]
cmds:
- CDK_DEFAULT_REGION=$AWS_DEFAULT_REGION
- CDK_DEFAULT_ACCOUNT="{{.account}}"
silent: true
bootstrap:
desc: CDK Bootstrap
cmds:
- task: synth
- cdk bootstrap --require-approval never
vars:
ACCOUNT:
sh: aws sts get-caller-identity |jq -r .Account
silent: true
check_requirements:
desc: Just to test
cmds:
- jq --version
- aws --version
- cdk --version
preconditions:
- sh: "command -v jq"
msg: "yq is not installed. Please refer to: https://stedolan.github.io/jq/"
- sh: "command -v aws"
msg: "'aws' is not installed. Please refer to: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html"
- sh: "command -v cdk"
msg: "'cdk' is not installed. Please refer to: https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html"
silent: true