@@ -103,6 +103,16 @@ populate target=default_deploy_target platform=default_platform:
103103 if [[ -f ./ {{ workspace_dir }} / deployment/ deployment.yml ]]; then
104104 echo " ---" >> ./ {{ workspace_dir }} / deployment/ deployment.yml
105105 fi
106+ if [ -n " $CONTRAST_GHCR_READ" ]; then
107+ cat > " ./{{ workspace_dir }} /contrast-imagepuller.toml" <<EOF
108+ [registries]
109+ [registries." ghcr.io." ]
110+ auth = " $(printf " user-not-required-here:%s" " $CONTRAST_GHCR_READ" | base64 -w0)"
111+ EOF
112+ kubectl create secret generic contrast-node-installer-imagepuller-config \
113+ - -from-file " contrast-imagepuller.toml" =" ./{{ workspace_dir }} /contrast-imagepuller.toml"
114+ - -namespace {{ target }} ${namespace_suffix-} \
115+ fi
106116 dmesgFlag=" "
107117 # For debug, we already add the debugshell container which exposes the full journal.
108118 if [[ " ${debug:-}" != " true" ]]; then
@@ -335,12 +345,20 @@ get-credentials platform=default_platform:
335345 ;;
336346 esac
337347
348+ token=$(nix run -L .#scripts.get-read -token " projects/796962942582/secrets/ghcr-read-token/versions/latest" )
349+ sed -i " s/^CONTRAST_GHCR_READ=.*/CONTRAST_GHCR_READ=\" ${token}\" /" justfile .env
350+
338351# Load the kubeconfig from the dev cluster.
339352get-credentials-dev :
353+ #!/usr/bin/env bash
354+ set -euo pipefail
340355 nix run -L .#scripts.get-credentials "projects/796962942582/secrets/hetzner-ax162-snp-kubeconfig/versions/latest"
341356 sed -i ' s/^default_platform=.*/default_platform="Metal-QEMU-SNP"/' justfile .env
342357 sed -i ' s/^node_installer_target_conf_type=.*/node_installer_target_conf_type="k3s"/' justfile .env
343358
359+ token=$(nix run -L .#scripts.get-read -token " projects/796962942582/secrets/ghcr-read-token/versions/latest" )
360+ sed -i " s/^CONTRAST_GHCR_READ=.*/CONTRAST_GHCR_READ=\" ${token}\" /" justfile .env
361+
344362# Run code generators.
345363codegen :
346364 nix run -L .#scripts.generate
@@ -395,6 +413,8 @@ namespace_suffix=""
395413CONTRAST_CACHE_DIR="./workspace.cache"
396414# Log level for the CLI.
397415CONTRAST_LOG_LEVEL=""
416+ # A Github token with read access to Contrast's ghcr.io packages.
417+ CONTRAST_GHCR_READ=""
398418'''
399419
400420# Developer onboarding.
0 commit comments