feat: add repo taskfile for cleaning up repo
Signed-off-by: Devin Buhl <devin@buhl.casa>
This commit is contained in:
5 files changed
+47
-8
No files matched your search
@@ -36,7 +36,7 @@
|
|||||||
},
|
},
|
||||||
"kustomize": {
|
"kustomize": {
|
||||||
"fileMatch": [
|
"fileMatch": [
|
||||||
"(^|/)kustomization\\.ya?ml(\\.j2)?$"
|
"(^|/)kustomization\\.ya?ml(\\.j2)?(\\.j2)?$"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
// commit message topics
|
// commit message topics
|
||||||
@@ -228,7 +228,7 @@
|
|||||||
"(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
"(^|/)addons/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
||||||
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
"(^|/)ansible/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
||||||
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
"(^|/)kubernetes/.+\\.ya?ml(\\.j2)?(\\.j2)?$",
|
||||||
"(^|/)k0s/.+\\.ya?ml(\\.j2)?(\\.j2)?$"
|
"(^|/)k0s-config.ya?ml(\\.j2)?(\\.j2)?$"
|
||||||
],
|
],
|
||||||
"matchStrings": [
|
"matchStrings": [
|
||||||
// Example: `k3s_release_version: "v1.27.3+k3s1"`
|
// Example: `k3s_release_version: "v1.27.3+k3s1"`
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ kubeconfig
|
|||||||
*.agekey
|
*.agekey
|
||||||
*.pub
|
*.pub
|
||||||
*.key
|
*.key
|
||||||
|
# Private
|
||||||
|
.private
|
||||||
# Ansible
|
# Ansible
|
||||||
.venv*
|
.venv*
|
||||||
# Taskfile
|
# Taskfile
|
||||||
|
|||||||
@@ -29,12 +29,6 @@ tasks:
|
|||||||
- { msg: "Flux already appears installed", sh: "kubectl get namespace flux-system &>/dev/null && exit 1 || exit 0" }
|
- { msg: "Flux already appears installed", sh: "kubectl get namespace flux-system &>/dev/null && exit 1 || exit 0" }
|
||||||
- { msg: "Age private key not found", sh: "test -f {{.ROOT_DIR}}/age.key" }
|
- { msg: "Age private key not found", sh: "test -f {{.ROOT_DIR}}/age.key" }
|
||||||
|
|
||||||
github-deploy-key:
|
|
||||||
cmds:
|
|
||||||
- sops --decrypt {{.KUBERNETES_DIR}}/bootstrap/github-deploy-key.sops.yaml | kubectl apply -f -
|
|
||||||
preconditions:
|
|
||||||
- { msg: "Flux is not installed", sh: "kubectl get namespace flux-system &>/dev/null && exit 0 || exit 1" }
|
|
||||||
|
|
||||||
apply:
|
apply:
|
||||||
desc: Apply a Flux Kustomization resource for a cluster
|
desc: Apply a Flux Kustomization resource for a cluster
|
||||||
summary: |
|
summary: |
|
||||||
@@ -61,3 +55,9 @@ tasks:
|
|||||||
reconcile:
|
reconcile:
|
||||||
desc: Force update Flux to pull in changes from your Git repository
|
desc: Force update Flux to pull in changes from your Git repository
|
||||||
cmd: flux reconcile --namespace flux-system kustomization cluster --with-source
|
cmd: flux reconcile --namespace flux-system kustomization cluster --with-source
|
||||||
|
|
||||||
|
github-deploy-key:
|
||||||
|
cmds:
|
||||||
|
- sops --decrypt {{.KUBERNETES_DIR}}/bootstrap/github-deploy-key.sops.yaml | kubectl apply --server-side --filename -
|
||||||
|
preconditions:
|
||||||
|
- { msg: "Flux is not installed", sh: "kubectl get namespace flux-system &>/dev/null && exit 0 || exit 1" }
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
---
|
||||||
|
# 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:
|
||||||
|
# Move bootstrap directory to gitignored directory
|
||||||
|
- mkdir -p {{.ROOT}}/.private
|
||||||
|
- mv {{.ROOT}}/bootstrap {{.ROOT}}/.private
|
||||||
|
# Update renovate.json5
|
||||||
|
- sed -i '' 's/(..\.j2)\?(..\.j2)\?//g' {{.ROOT}}/.github/renovate.json5
|
||||||
|
- sed -i '' 's/addons/d' {{.ROOT}}/.github/renovate.json5
|
||||||
|
preconditions:
|
||||||
|
- { msg: "bootstrap dir not found", sh: "test -d {{.ROOT}}/bootstrap" }
|
||||||
|
- { msg: "renovate.json5 not found", sh: "test -f {{.ROOT_DIR}}/.github/renovate.json5" }
|
||||||
|
|
||||||
|
reset:
|
||||||
|
desc: Remove templated configuration files
|
||||||
|
prompt: Remove templated configuration files... continue?
|
||||||
|
cmds:
|
||||||
|
- rm -rf {{.ROOT}}/.sops.yaml
|
||||||
|
- rm -rf {{.ROOT}}/k0s-config.yaml
|
||||||
|
- rm -rf {{.ROOT}}/ansible
|
||||||
|
- rm -rf {{.ROOT}}/kubernetes
|
||||||
|
|
||||||
|
reset-repo:
|
||||||
|
desc: Set repo back to HEAD
|
||||||
|
prompt: Set repo back to HEAD... continue?
|
||||||
|
cmds:
|
||||||
|
- task: reset
|
||||||
|
- git reset --hard HEAD
|
||||||
|
- git clean -f -d
|
||||||
|
- git pull
|
||||||
@@ -18,6 +18,7 @@ includes:
|
|||||||
taskfile: .taskfiles/KubernetesTasks.yaml
|
taskfile: .taskfiles/KubernetesTasks.yaml
|
||||||
flux: .taskfiles/FluxTasks.yaml
|
flux: .taskfiles/FluxTasks.yaml
|
||||||
k0s: .taskfiles/K0sTasks.yaml
|
k0s: .taskfiles/K0sTasks.yaml
|
||||||
|
repo: .taskfiles/RepoTasks.yaml
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user