-
Notifications
You must be signed in to change notification settings - Fork 5
/
Taskfile.yml
130 lines (117 loc) · 3.45 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
# https://taskfile.dev
version: '3'
vars:
VERSION_DYNAMIC:
sh: cat ./charts/opslevel/Chart.yaml | yq '.version'
tasks:
setup:
desc: Workflow to run in CI to prepare self-hosted release
deps:
- install-kubectl
- install-krew
cmds:
- task: install-helm
- task: install-kubectl-slice
- task: install-replicated
release-self-hosted:
desc: Workflow to run in CI to prepare self-hosted release
cmds:
- task: package-self-hosted
- task: lint-self-hosted
- task: publish-self-hosted
render-self-hosted:
desc: Workflow that runs helm template and kubectl slice to inspected the rendered template
deps:
- install-helm
- install-kubectl-slice
cmds:
- helm template ./charts/opslevel > all.yaml
- kubectl slice --input-file=all.yaml --output-dir=./rendered
- rm all.yaml
package-self-hosted:
desc: Create the chart package for self-hosted chart
deps:
- install-helm
cmds:
- helm package ./charts/opslevel --dependency-update
- mkdir -p ./manifests
- mv ./opslevel-{{ .VERSION_DYNAMIC }}.tgz ./manifests/opslevel-{{.VERSION_DYNAMIC}}.tgz
lint-self-hosted:
desc: Lint the self-hosted chart
deps:
- install-replicated
- package-self-hosted
cmds:
- replicated release lint --chart ./manifests/opslevel-{{ .VERSION_DYNAMIC }}.tgz --app opslevel
publish-self-hosted:
internal: true
desc: Release the self-hosted chart
requires:
vars: [REPLICATED_CHANNEL]
deps:
- install-replicated
cmds:
- replicated release create --chart ./manifests/opslevel-{{ .VERSION_DYNAMIC }}.tgz --app opslevel --version "{{ .VERSION_DYNAMIC }}" --promote "{{ .REPLICATED_CHANNEL }}" -y
pull-self-hosted:
desc: Pull the replicated helm chart down to disk to inspect it
requires:
vars: [REPLICATED_CHANNEL]
deps:
- install-helm
cmds:
- mkdir -p ./downloads
- helm pull --untar --untardir=./downloads oci://registry.replicated.com/opslevel/{{ .REPLICATED_CHANNEL | lower }}/opslevel
install-kubectl:
internal: true
platforms: [darwin]
preconditions:
- sh: 'which brew'
msg: '"brew" needed to install "helm"- see https://brew.sh'
status:
- test -n "command -v kubectl"
cmds:
- brew install kubectl
install-helm:
internal: true
platforms: [darwin]
preconditions:
- sh: 'which brew'
msg: '"brew" needed to install "helm"- see https://brew.sh'
status:
- test -n "command -v helm"
cmds:
- brew install helm
install-krew:
internal: true
platforms: [darwin]
deps:
- install-kubectl
preconditions:
- sh: 'which brew'
msg: '"brew" needed to install "helm"- see https://brew.sh'
status:
- test -n "command -v kubectl-krew"
cmds:
- brew install krew
install-kubectl-slice:
internal: true
platforms: [darwin]
deps:
- install-krew
preconditions:
- sh: 'which brew'
msg: '"brew" needed to install "helm"- see https://brew.sh'
status:
- test -n "command -v kubectl-slice"
cmds:
- kubectl krew install slice
install-replicated:
internal: true
platforms: [darwin]
preconditions:
- sh: 'which brew'
msg: '"brew" needed to install "helm"- see https://brew.sh'
status:
- test -n "command -v replicated"
cmds:
- brew install replicatedhq/replicated/cli