forked from kzwkt/dotfiles-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_onchange_before_20-install-kubernetes.sh.tmpl
41 lines (32 loc) · 1.86 KB
/
run_onchange_before_20-install-kubernetes.sh.tmpl
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
{{ if (and ( eq .chezmoi.os "linux") (.kubernetes) (ne .chezmoi.username "root")) -}}
#!/bin/bash
set -eufo pipefail
##--kubectl--##
# renovate: depName=kubernetes/kubernetes datasource=github-tags
current_kubectl_version=v1.22.4
if [ ! $(command -v kubectl) ] || [ $(kubectl version --short --client | head -n1 | cut -d" " -f3) != "$current_kubectl_version" ]; then
sudo curl -fL https://dl.k8s.io/release/$current_kubectl_version/bin/linux/{{ .chezmoi.arch }}/kubectl -o /usr/local/bin/kubectl
sudo chmod +x /usr/local/bin/kubectl
fi
##--flux--##
# renovate: depName=fluxcd/flux2 datasource=github-releases
current_flux_version=v0.23.0
if [ ! $(command -v flux) ] || [ $(flux version --client | head -n1 | cut -d" " -f2) != "$current_flux_version" ]; then
curl -s https://fluxcd.io/install.sh | sudo bash
fi
##--kustomize--##
# renovate: depName=kubernetes-sigs/kustomize datasource=github-releases
current_kustomize_version=kustomize/v4.4.1
current_kustomize_version_short=$(echo $current_kustomize_version | cut -d"/" -f2)
if [ ! $(command -v kustomize) ] || [ $(kustomize version --short | head -n1 | cut -d"/" -f2 | cut -d" " -f1) != "$current_kustomize_version_short" ]; then
curl -fL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F${current_kustomize_version_short}/kustomize_${current_kustomize_version_short}_linux_{{ .chezmoi.arch }}.tar.gz | sudo tar -xzf - -oC /usr/local/bin/
sudo chmod +x /usr/local/bin/kustomize
fi
##--SOPS--##
# renovate: depName=mozilla/sops datasource=github-releases
current_sops_version=v3.7.1
if [ ! $(command -v sops) ] || [ $(sops -v | head -n1 | cut -d" " -f2 | sed "s/^/v/") != "$current_sops_version" ]; then
sudo curl -fL https://github.com/mozilla/sops/releases/download/$current_sops_version/sops-$current_sops_version.linux -o /usr/local/bin/sops
sudo chmod +x /usr/local/bin/sops
fi
{{ end -}}