Rotate operator secrets into agenix and deepen caches
This commit is contained in:
parent
7039bf5aad
commit
03415e579b
28 changed files with 526 additions and 126 deletions
|
|
@ -6,12 +6,14 @@ REPO_ROOT="$(cd "${SCRIPT_DIR}/.." && pwd)"
|
|||
|
||||
# shellcheck source=Scripts/_burrow-flake.sh
|
||||
source "${SCRIPT_DIR}/_burrow-flake.sh"
|
||||
# shellcheck source=Scripts/_burrow-secrets.sh
|
||||
source "${SCRIPT_DIR}/_burrow-secrets.sh"
|
||||
|
||||
DEFAULT_CONFIG="burrow-forge"
|
||||
DEFAULT_FLAKE="."
|
||||
DEFAULT_LOCATION="hel1"
|
||||
DEFAULT_ARCHITECTURE="x86"
|
||||
DEFAULT_TOKEN_FILE="${REPO_ROOT}/intake/hetzner-api-token.txt"
|
||||
DEFAULT_TOKEN_FILE=""
|
||||
|
||||
CONFIG="${HCLOUD_IMAGE_CONFIG:-${DEFAULT_CONFIG}}"
|
||||
FLAKE="${HCLOUD_IMAGE_FLAKE:-${DEFAULT_FLAKE}}"
|
||||
|
|
@ -30,6 +32,13 @@ NIX_BUILD_FLAGS=()
|
|||
BURROW_FLAKE_TMPDIRS=()
|
||||
LOCAL_STORE_DIR=""
|
||||
|
||||
cleanup() {
|
||||
burrow_cleanup_secret_tmpfiles
|
||||
burrow_cleanup_flake_tmpdirs
|
||||
}
|
||||
|
||||
trap cleanup EXIT
|
||||
|
||||
usage() {
|
||||
cat <<'EOF'
|
||||
Usage: Scripts/hcloud-upload-nixos-image.sh [options]
|
||||
|
|
@ -42,7 +51,7 @@ Options:
|
|||
--location <code> Hetzner location for the temporary upload server (default: hel1)
|
||||
--architecture <x86|arm> CPU architecture of the image (default: x86)
|
||||
--server-type <name> Hetzner server type for the temporary upload server
|
||||
--token-file <path> Hetzner API token file (default: intake/hetzner-api-token.txt)
|
||||
--token-file <path> Hetzner API token file (default: secrets/hetzner/api-token.age, then intake/hetzner-api-token.txt)
|
||||
--artifact-path <path> Prebuilt raw image artifact to upload directly
|
||||
--output-hash <hash> Stable hash label for --artifact-path uploads
|
||||
--builder-spec <string> Complete builders string passed to nix build
|
||||
|
|
@ -125,6 +134,17 @@ while [[ $# -gt 0 ]]; do
|
|||
esac
|
||||
done
|
||||
|
||||
TOKEN_FILE="$(
|
||||
burrow_resolve_secret_file \
|
||||
"${REPO_ROOT}" \
|
||||
"${TOKEN_FILE}" \
|
||||
"${REPO_ROOT}/intake/hetzner-api-token.txt" \
|
||||
"${REPO_ROOT}/secrets/hetzner/api-token.age"
|
||||
)" || {
|
||||
echo "Hetzner API token file could not be resolved" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
cleanup() {
|
||||
burrow_cleanup_flake_tmpdirs
|
||||
if [[ -n "${LOCAL_STORE_DIR}" && -d "${LOCAL_STORE_DIR}" ]]; then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue