-
Notifications
You must be signed in to change notification settings - Fork 3
/
Taskfile.yml
107 lines (88 loc) · 3.13 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
version: '2'
expansions: 5
vars:
ROOT_PATH: {sh: pwd}
HOME_PATH: "{{.ROOT_PATH}}/.local"
BIN_PATH: "{{.HOME_PATH}}/bin"
CONFIG_PATH: "{{.ROOT_PATH}}/config"
HELMFILE: "{{.BIN_PATH}}/helmfile"
HELM_BINARY: "{{.BIN_PATH}}/helm"
env:
XDG_CACHE_HOME: "{{.HOME_PATH}}"
XDG_CONFIG_HOME: "{{.HOME_PATH}}"
XDG_DATA_HOME: "{{.HOME_PATH}}"
CLUSTER: cicd
STACK: cluster.cicd
tasks:
show:
desc: Show environment and variable settings
silent: true
cmds:
- echo "CLUSTER=$CLUSTER"
- echo "ENVIRONMENT=$ENVIRONMENT"
- echo "ARCH={{ARCH}}"
- echo "OS={{OS}}"
- echo "KUBE_VERSION=$KUBE_VERSION"
- echo "HELMFILE_PATH=helmfiles"
- echo "STACK=$STACK"
- echo "HELMFILE_VALUES=$HELMFILE_VALUES"
show:helm:
desc: Show helm settings
summary: |
Show helm settings used in this task runner.
This can be useful for exporting the values for sourcing into your own shell
silent: true
cmds:
- echo "export XDG_CACHE_HOME=$XDG_CACHE_HOME"
- echo "export XDG_CONFIG_HOME=$XDG_CONFIG_HOME"
- echo "export XDG_DATA_HOME=$XDG_DATA_HOME"
- echo "alias hlm={{.HELM_BINARY}}"
helmfile:stacks:
desc: Lists all available helmfile stacks
silent: true
cmds:
- ls helmfiles/helmfile.*.yaml | xargs -n1 basename | sed -e 's/\.yaml//g' -e 's/helmfile\.//g'
helmfile:apply:
desc: apply all resources from state file only when there are changes
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml apply"
helmfile:sync:
desc: Sync STACK with cluster
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml sync"
helmfile:charts:
desc: Like helmfile:sync but offline with already downloaded charts
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml charts"
helmfile:repos:
desc: Helm repo add and update
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml repos"
helmfile:list:
desc: List resources in state file
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml list"
helmfile:diff:
desc: diffs STACK with cluster
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml diff"
helmfile:test:
desc: Tests STACK on cluster
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml test"
helmfile:destroy:
desc: Removes STACK from cluster
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml destroy"
helmfile:build:
desc: Builds helmfile YAML only
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml build"
helmfile:template:
desc: template STACK yaml manifest for cluster
cmds:
- "{{.HELMFILE}} -b {{.HELM_BINARY}} -e $ENVIRONMENT -f helmfiles/helmfile.$STACK.yaml template"
sync:
desc: Shortcut for helmfile:sync task
cmds:
- task: helmfile:sync