-
-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add task for updating from the upstream template
Signed-off-by: Devin Buhl <[email protected]>
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,3 +10,5 @@ kubeconfig | |
*.key | ||
# Ansible | ||
.venv* | ||
# Taskfile | ||
.tasks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ tasks: | |
|
||
deps: | ||
desc: Create a Python virtual env and install required packages | ||
summary: task {{.TASK}} | ||
cmds: | ||
- "{{.PYTHON_BIN}} -m venv {{.ROOT_DIR}}/.venv" | ||
- .venv/bin/python3 -m pip install --upgrade pip setuptools wheel | ||
|
@@ -36,6 +37,7 @@ tasks: | |
|
||
init: | ||
desc: Initialize configuration files | ||
summary: task {{.TASK}} | ||
dir: "{{.BOOTSTRAP_DIR}}" | ||
cmds: | ||
- cp -n vars/addons.sample.yaml vars/addons.yaml | ||
|
@@ -54,10 +56,27 @@ tasks: | |
|
||
configure: | ||
desc: Configure repository from Ansible vars | ||
summary: task {{.TASK}} | ||
# TODO: Only prompt when directories exist | ||
# https://github.com/go-task/task/issues/1330 | ||
prompt: Any conflicting config in the root kubernetes and ansible directories will be overwritten... continue? | ||
dir: "{{.BOOTSTRAP_DIR}}" | ||
cmd: ansible-playbook configure.yaml | ||
env: | ||
ANSIBLE_DISPLAY_SKIPPED_HOSTS: "false" | ||
|
||
update-template: | ||
desc: Update from the upstream flux-cluster-template repository | ||
summary: task {{.TASK}} | ||
cmds: | ||
- mkdir -p $(dirname {{.shafile}}) | ||
- touch {{.shafile}} | ||
- git remote get-url template >/dev/null 2>&1 || git remote add template [email protected]:onedr0p/flux-cluster-template | ||
- git fetch --all | ||
- git cherry-pick --no-commit --allow-empty $(cat {{.shafile}})..template/main | ||
- git ls-remote template HEAD | awk '{ print $1}' > {{.shafile}} | ||
vars: | ||
shafile: "{{.ROOT_DIR}}/.tasks/.latest-template.sha" | ||
preconditions: | ||
- { msg: "Git repository not up-to-date", sh: "git diff --exit-code" } | ||
- { msg: "Git repository not up-to-date", sh: "git diff --cached --exit-code" } |