Files
home-cluster/.taskfiles/Repo/Taskfile.yaml
T
2024-01-15 00:03:41 -05:00

40 lines
1.4 KiB
YAML

---
# yaml-language-server: $schema=https://taskfile.dev/schema.json
version: "3"
tasks:
clean:
desc: Clean files and directories no longer needed after cluster bootstrap
cmds:
# Clean up CI
- rm -rf {{.ROOT_DIR}}/.github/tests
- rm -rf {{.ROOT_DIR}}/.github/workflows/e2e.yaml
# Move bootstrap directory to gitignored directory
- mkdir -p {{.ROOT_DIR}}/.private
- mv {{.BOOTSTRAP_DIR}} {{.ROOT_DIR}}/.private/bootstrap-{{now | date "150405"}}
- mv {{.ROOT_DIR}}/makejinja.toml {{.ROOT_DIR}}/.private/makejinja-{{now | date "150405"}}.toml
# Update renovate.json5
- sed -i {{if eq OS "darwin"}}''{{end}} 's/(..\.j2)\?(..\.j2)\?//g' {{.ROOT_DIR}}/.github/renovate.json5
preconditions:
- { msg: "bootstrap dir not found", sh: "test -d {{.BOOTSTRAP_DIR}}" }
- { msg: "renovate.json5 not found", sh: "test -f {{.ROOT_DIR}}/.github/renovate.json5" }
reset:
desc: Reset templated configuration files
prompt: Reset templated configuration files... continue?
cmds:
- rm -rf {{.ROOT_DIR}}/.sops.yaml
- rm -rf {{.ROOT_DIR}}/k0s-config.yaml
- rm -rf {{.ANSIBLE_DIR}}
- rm -rf {{.KUBERNETES_DIR}}
force-reset:
desc: Reset repo back to HEAD
prompt: Reset repo back to HEAD... continue?
cmds:
- task: reset
- git reset --hard HEAD
- git clean -f -d
- git pull origin main