fix: improve taskfiles and e2e test (#1615)

This commit is contained in:
Devin Buhl authored and GitHub committed 2024-10-26 14:01:59 -04:00
1 parent d71c3e163d
commit 68e07e7807
6 files changed
+103 -61

No files matched your search

+23 -7
View File
@@ -76,14 +76,30 @@ tasks:
status:
- test -f {{.SOPS_AGE_KEY_FILE}}
encrypt:
desc: Encrypt all Kubernetes SOPS secrets
cmd: |
find "{{.KUBERNETES_DIR}}" -type f -name "*.sops.*" | while read -r file; do
if sops filestatus "${file}" | jq --exit-status ".encrypted == false" &>/dev/null; then
sops --encrypt --in-place "${file}"
template:
internal: true
cmd: '{{.VIRTUAL_ENV}}/bin/makejinja'
preconditions:
- msg: Missing virtual environment
sh: test -d {{.VIRTUAL_ENV}}
- msg: Missing Makejinja config file
sh: test -f {{.MAKEJINJA_CONFIG_FILE}}
- msg: Missing Makejinja plugin file
sh: test -f {{.BOOTSTRAP_DIR}}/scripts/plugin.py
- msg: Missing bootstrap config file
sh: test -f {{.BOOTSTRAP_CONFIG_FILE}}
secrets:
internal: true
cmds:
- for: { var: SECRET_FILES }
cmd: |
if sops filestatus "{{.ITEM}}" | jq --exit-status ".encrypted == false" &>/dev/null; then
sops --encrypt --in-place "{{.ITEM}}"
fi
done
vars:
SECRET_FILES:
sh: find "{{.KUBERNETES_DIR}}" -type f -name "*.sops.*"
preconditions:
- msg: Missing Sops config file
sh: test -f {{.SOPS_CONFIG_FILE}}
+1
View File
@@ -10,6 +10,7 @@ jq
kubeconform
kubectl-bin
kustomize
minijinja
moreutils
sops
stern-bin
+1
View File
@@ -12,6 +12,7 @@ brew "jq"
brew "kubeconform"
brew "kubernetes-cli"
brew "kustomize"
brew "minijinja-cli"
brew "moreutils"
brew "siderolabs/tap/talosctl"
brew "sops"
+27 -19
View File
@@ -9,10 +9,10 @@ tasks:
cmd: '{{.PKGMGR}} -Syu --needed --noconfirm --noprogressbar $(cat {{.ROOT_DIR}}/.taskfiles/workstation/Archfile | xargs)'
vars:
PKGMGR:
sh: command -v yay || command -v paru
sh: command -v paru || command -v yay
preconditions:
- msg: Missing yay or paru
sh: command -v brew &>/dev/null || command -v paru &>/dev/null
- msg: Missing paru or yay
sh: command -v paru &>/dev/null || command -v yay &>/dev/null
- msg: Missing Archfile
sh: test -f {{.ROOT_DIR}}/.taskfiles/workstation/Archfile
@@ -46,24 +46,32 @@ tasks:
platforms: ['linux/amd64', 'linux/arm64']
cmds:
- for:
- budimanjojo/talhelper?as=talhelper&type=script
- cloudflare/cloudflared?as=cloudflared&type=script
- FiloSottile/age?as=age&type=script
- fluxcd/flux2?as=flux&type=script
- getsops/sops?as=sops&type=script
- helmfile/helmfile?as=helmfile&type=script
- jqlang/jq?as=jq&type=script
- kubernetes-sigs/kustomize?as=kustomize&type=script
- siderolabs/talos?as=talosctl&type=script
- yannh/kubeconform?as=kubeconform&type=script
- mikefarah/yq?as=yq&type=script
cmd: curl -fsSL "https://i.jpillora.com/{{.ITEM}}" | bash
- cmd: curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
- budimanjojo/talhelper?as=talhelper
- cloudflare/cloudflared?as=cloudflared
- FiloSottile/age?as=age
- fluxcd/flux2?as=flux
- helmfile/helmfile?as=helmfile
- jqlang/jq?as=jq
- kubernetes-sigs/kustomize?as=kustomize
- mikefarah/yq?as=yq
- siderolabs/talos?as=talosctl
- yannh/kubeconform?as=kubeconform
cmd: curl -fsSL "https://i.jpillora.com/{{.ITEM}}&type=script" | bash
- cmd: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl";
curl -sSfL -o sops https://github.com/getsops/sops/releases/latest/download/sops-v3.9.1.linux.amd64
platforms: ['linux/amd64']
- cmd: curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
- cmd: |
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl";
curl -sSfL -o sops https://github.com/getsops/sops/releases/latest/download/sops-v3.9.1.linux.arm64
platforms: ['linux/arm64']
- cmd: chmod +x kubectl
- cmd: curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | USE_SUDO="false" HELM_INSTALL_DIR="." bash
- cmd: chmod +x kubectl sops
- cmd: curl -sSfL https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash
- cmd: curl -sSfL https://github.com/mitsuhiko/minijinja/releases/latest/download/minijinja-cli-installer.sh | bash
env:
MINIJINJA_CLI_INSTALL_DIR: '.'
HELM_INSTALL_DIR: '.'
USE_SUDO: 'false'
venv:
desc: Set up virtual environment