Files
home-cluster/.taskfiles/Workstation/Taskfile.yaml
T

83 lines
3.1 KiB
YAML

---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: '3'
tasks:
arch:
desc: Set up Arch Linux tools
cmd: '{{.PKGMGR}} -Syu --needed --noconfirm --noprogressbar $(cat {{.ROOT_DIR}}/.taskfiles/Workstation/Archfile | xargs)'
vars:
PKGMGR:
sh: command -v yay || command -v paru
preconditions:
- msg: Missing yay or paru
sh: command -v brew &>/dev/null || command -v paru &>/dev/null
- msg: Missing Archfile
sh: test -f {{.ROOT_DIR}}/.taskfiles/Workstation/Archfile
brew:
desc: Set up Homebrew tools
cmds:
- brew bundle --file {{.ROOT_DIR}}/.taskfiles/Workstation/Brewfile
sources:
- '{{.ROOT_DIR}}/.taskfiles/Workstation/Brewfile'
generates:
- '{{.ROOT_DIR}}/.taskfiles/Workstation/Brewfile.lock.json'
preconditions:
- msg: Missing brew
sh: command -v brew &>/dev/null
- msg: Missing Brewfile
sh: test -f {{.ROOT_DIR}}/.taskfiles/Workstation/Brewfile
direnv:
desc: Run direnv hooks
cmd: direnv allow .
status:
- '[[ $(direnv status --json | jq ".state.foundRC.allowed") == 0 ]]'
- '[[ $(direnv status --json | jq ".state.loadedRC.allowed") == 0 ]]'
preconditions:
- msg: Missing direnv
sh: command -v direnv &>/dev/null
generic-linux:
desc: Setup CLI tools into the projects .bin directory
dir: '{{.ROOT_DIR}}/.bin'
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"
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"
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
venv:
desc: Set up virtual environment
cmds:
- python3 -m venv {{.VIRTUAL_ENV}}
- '{{.VIRTUAL_ENV}}/bin/python3 -m pip install --upgrade pip setuptools wheel'
- '{{.VIRTUAL_ENV}}/bin/python3 -m pip install --upgrade --requirement "{{.ROOT_DIR}}/requirements.txt"'
sources:
- '{{.ROOT_DIR}}/requirements.txt'
generates:
- '{{.VIRTUAL_ENV}}/pyvenv.cfg'
preconditions:
- msg: Missing python3
sh: command -v python3 &>/dev/null
- msg: Missing Pip requirements file
sh: test -f {{.ROOT_DIR}}/requirements.txt