From dd1f5db1083d599479b302e955b475bb4019bb49 Mon Sep 17 00:00:00 2001 From: Sebastian Pietras Date: Tue, 26 Mar 2024 20:43:08 +0100 Subject: [PATCH] Fetched template changes (#92) --- .copier-answers.yaml | 2 +- .devcontainer/devcontainer.json | 7 ++++++- .devcontainer/image/hooks/create.sh | 8 ++++---- .devcontainer/image/setup.sh | 20 ++++++++++---------- .github/workflows/docs.yaml | 2 +- .github/workflows/lint.yaml | 2 +- docs/package.json | 4 ++-- 7 files changed, 25 insertions(+), 20 deletions(-) diff --git a/.copier-answers.yaml b/.copier-answers.yaml index e66d69c..ba29488 100644 --- a/.copier-answers.yaml +++ b/.copier-answers.yaml @@ -1,5 +1,5 @@ # Changes here will be overwritten by Copier; NEVER EDIT MANUALLY -_commit: 0.5.0 +_commit: 0.6.0 _src_path: gh:quickplates/generic accountname: spietras description: Flux manifests for my k8s clusters ☸️ diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 6b1cd88..6cbd7f0 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,7 +4,12 @@ // Docker context to use, relative to this file "context": "image/", // Dockerfile to use, relative to this file - "dockerfile": "image/Dockerfile" + "dockerfile": "image/Dockerfile", + // Build options + "options": [ + // Use host network + "--network=host" + ] }, // Tool-specific settings "customizations": { diff --git a/.devcontainer/image/hooks/create.sh b/.devcontainer/image/hooks/create.sh index 5bf8d68..8fc22df 100755 --- a/.devcontainer/image/hooks/create.sh +++ b/.devcontainer/image/hooks/create.sh @@ -13,10 +13,10 @@ if [[ -s /secrets/.ghtoken && -r /secrets/.ghtoken ]]; then configfile="${confighome}/nix/nix.conf" tmpfile="$(mktemp)" - mkdir -p "$(dirname "${configfile}")" + mkdir --parents "$(dirname "${configfile}")" touch "${configfile}" - if grep -q extra-access-tokens "${configfile}"; then + if grep --quiet extra-access-tokens "${configfile}"; then sed "s|extra-access-tokens.*|extra-access-tokens = github.com=${token}|" "${configfile}" >"${tmpfile}" cat "${tmpfile}" >"${configfile}" rm "${tmpfile}" @@ -31,6 +31,6 @@ if [[ -s /secrets/.agekeys && -r /secrets/.agekeys ]]; then # Copy age keys to SOPS config targetfile="${confighome}/sops/age/keys.txt" - mkdir -p "$(dirname "${targetfile}")" - cp -f /secrets/.agekeys "${targetfile}" + mkdir --parents "$(dirname "${targetfile}")" + cp --force /secrets/.agekeys "${targetfile}" fi diff --git a/.devcontainer/image/setup.sh b/.devcontainer/image/setup.sh index 51e5560..b16dc50 100755 --- a/.devcontainer/image/setup.sh +++ b/.devcontainer/image/setup.sh @@ -2,10 +2,10 @@ REMOTE_USER="${REMOTE_USER:?}" REMOTE_USER_PASSWD="$(getent passwd "${REMOTE_USER}")" -REMOTE_USER_HOME="$(echo "${REMOTE_USER_PASSWD}" | cut -d: -f6)" +REMOTE_USER_HOME="$(echo "${REMOTE_USER_PASSWD}" | cut --delimiter ':' --fields 6)" # Setup default shell -chsh -s /usr/bin/zsh "${REMOTE_USER}" +chsh --shell /usr/bin/zsh "${REMOTE_USER}" # Setup direnv cat <>"${REMOTE_USER_HOME}/.bashrc" @@ -26,17 +26,17 @@ eval "\$(starship init zsh)" EOF # Setup secrets directory -mkdir -p /secrets/ +mkdir --parents /secrets/ -chown -R "${REMOTE_USER}:" /secrets/ +chown --recursive "${REMOTE_USER}:" /secrets/ # Setup shell history cache -mkdir -p /persist/shellhistory/ +mkdir --parents /persist/shellhistory/ touch /persist/shellhistory/.bash_history touch /persist/shellhistory/.zsh_history -chown -R "${REMOTE_USER}:" /persist/shellhistory/ +chown --recursive "${REMOTE_USER}:" /persist/shellhistory/ cat <>"${REMOTE_USER_HOME}/.bashrc" export HISTFILE=/persist/shellhistory/.bash_history @@ -47,9 +47,9 @@ export HISTFILE=/persist/shellhistory/.zsh_history EOF # Setup trunk cache -mkdir -p /cache/trunk/ +mkdir --parents /cache/trunk/ -chown -R "${REMOTE_USER}:" /cache/trunk/ +chown --recursive "${REMOTE_USER}:" /cache/trunk/ cat <>"${REMOTE_USER_HOME}/.bashrc" export TRUNK_CACHE=/cache/trunk/ @@ -60,9 +60,9 @@ export TRUNK_CACHE=/cache/trunk/ EOF # Setup npm cache -mkdir -p /cache/npm/ +mkdir --parents /cache/npm/ -chown -R "${REMOTE_USER}:" /cache/npm/ +chown --recursive "${REMOTE_USER}:" /cache/npm/ cat <>"${REMOTE_USER_HOME}/.bashrc" export NPM_CONFIG_CACHE=/cache/npm/ diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 34ebb41..ec29868 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -86,7 +86,7 @@ jobs: if: "!cancelled()" run: > mkdir - -p + --parents ${{ env.NIX_CACHE_DIR }} && nix-store diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index ff5ce06..b8424e8 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -102,7 +102,7 @@ jobs: if: "!cancelled()" run: > mkdir - -p + --parents ${{ env.NIX_CACHE_DIR }} && nix-store diff --git a/docs/package.json b/docs/package.json index 3856de8..b972839 100644 --- a/docs/package.json +++ b/docs/package.json @@ -4,9 +4,9 @@ "scripts": { "docs": "docusaurus", "update": "ncu --peer --doctor --upgrade && npm i --no-audit --no-fund", - "postupdate": "rm -rf .tmp/", + "postupdate": "rm --recursive --force .tmp/", "test": "docusaurus build --out-dir .tmp/", - "posttest": "rm -rf .tmp/" + "posttest": "rm --recursive --force .tmp/" }, "engines": { "node": ">=18.0"