-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathTaskfile.yml
53 lines (49 loc) · 1.34 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
# https://taskfile.dev
version: '3'
dotenv:
# for now this is a copy of azure.bradfordwagner-infra.sh
- .secrets.sh
env:
KUBECONFIG: '{{ .HOME }}/.kube/admin'
VAULT_ADDR: https://bradfordwagner.com:8200
VAULT_FORMAT: json
kv2_path: secret/tf.cicd
tasks:
clear:
cmds: [clear]
internal: true
cluster_create:
aliases: [cc]
cmds:
- task: clear
- ./kind.sh create
- terraform init
- terraform apply -auto-approve
- ./startup.sh
cluster_delete:
aliases: [cd]
cmds:
- task: clear
- ./kind.sh delete
kubernetes_apply:
aliases: [ka]
cmds:
- task: clear
- kubectl apply -f ./argocd/bootstrap
kubernetes_delete:
aliases: [kd]
cmds:
- task: clear
- kubectl delete -f ./argocd/bootstrap
vault_write_secrets:
aliases: [vws]
cmds:
- task: clear
- vault kv put {{ .kv2_path }} secrets="$(cat .secrets.sh)" certificate="$(cat .certificate)" private_key="$(cat .private_key)"
vault_read_secrets:
aliases: [vrs]
cmds:
- task: clear
- vault kv get -format=json {{ .kv2_path }} | jq -r '.data.data.secrets' > .secrets.sh
- vault kv get -format=json {{ .kv2_path }} | jq -r '.data.data.certificate' > .certificate
- vault kv get -format=json {{ .kv2_path }} | jq -r '.data.data.private_key' > .private_key