From 21a3f38fe1940fe1b361403278829f4804dcfcc1 Mon Sep 17 00:00:00 2001 From: pat-s Date: Sun, 14 Jun 2026 11:06:37 +0200 Subject: [PATCH 1/2] fix(local): accept TF_VAR_-prefixed B2 keys and make GITHUB_PAT optional --- justfile | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/justfile b/justfile index a475505..06f2200 100644 --- a/justfile +++ b/justfile @@ -38,20 +38,28 @@ rebuild os tag arch package *versions: arm64) builder="{{ arm64_builder }}" ;; *) echo "error: arch must be 'amd64' or 'arm64'" >&2; exit 1 ;; esac - : "${B2_S3_ACCESS_KEY:?set B2_S3_ACCESS_KEY in your environment}" - : "${B2_S3_SECRET_KEY:?set B2_S3_SECRET_KEY in your environment}" - : "${PGPASS:?set PGPASS in your environment}" - : "${GITHUB_PAT:=}" + # Accept TF_VAR_-prefixed names (direnv) or plain names. + export B2_S3_ACCESS_KEY="${B2_S3_ACCESS_KEY:-${TF_VAR_B2_S3_ACCESS_KEY:-}}" + export B2_S3_SECRET_KEY="${B2_S3_SECRET_KEY:-${TF_VAR_B2_S3_SECRET_KEY:-}}" + : "${B2_S3_ACCESS_KEY:?set B2_S3_ACCESS_KEY or TF_VAR_B2_S3_ACCESS_KEY}" + : "${B2_S3_SECRET_KEY:?set B2_S3_SECRET_KEY or TF_VAR_B2_S3_SECRET_KEY}" + : "${PGPASS:?set PGPASS}" + secret_args=( + --secret id=b2_access,env=B2_S3_ACCESS_KEY + --secret id=b2_secret,env=B2_S3_SECRET_KEY + --secret id=pgpass,env=PGPASS + ) + # GITHUB_PAT is optional (raises the GitHub API rate limit); pass only if set. + if [ -n "${GITHUB_PAT:-}" ]; then + secret_args+=(--secret id=github_pat,env=GITHUB_PAT) + fi echo "Dispatching build of {{ package }} ({{ versions }}) on {{ os }}:{{ tag }}/{{ arch }} (R {{ r_version }}) to builder '$builder'" docker buildx build \ --builder "$builder" \ --platform "linux/{{ arch }}" \ --no-cache \ --output type=cacheonly \ - --secret id=b2_access,env=B2_S3_ACCESS_KEY \ - --secret id=b2_secret,env=B2_S3_SECRET_KEY \ - --secret id=pgpass,env=PGPASS \ - --secret id=github_pat,env=GITHUB_PAT \ + "${secret_args[@]}" \ --build-arg OS="{{ os }}" \ --build-arg OS_VERSION="{{ tag }}" \ --build-arg R_VERSION="{{ r_version }}" \ From c8412dcdb1d799fc6f8f0d8c6ae25103c67369b0 Mon Sep 17 00:00:00 2001 From: pat-s Date: Sun, 14 Jun 2026 11:12:33 +0200 Subject: [PATCH 2/2] docs(local): document docker-container driver for buildx builders --- justfile | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/justfile b/justfile index 06f2200..b70f549 100644 --- a/justfile +++ b/justfile @@ -7,9 +7,11 @@ # refreshed so the result is immediately servable. # # Prerequisites: -# - buildx builders named `artemis` (amd64) and `gaia` (arm64), e.g. -# docker buildx create --name artemis --node artemis ssh:// -# docker buildx create --name gaia --node gaia ssh:// +# - buildx builders named `artemis` (amd64) and `gaia` (arm64), created with the +# docker-container driver (runs BuildKit on the remote host's docker daemon over +# SSH). The default `remote` driver does NOT work with an ssh:// docker host. +# docker buildx create --name artemis --driver docker-container ssh:// +# docker buildx create --name gaia --driver docker-container ssh:// # - exported secrets: B2_S3_ACCESS_KEY, B2_S3_SECRET_KEY, PGPASS (GITHUB_PAT optional) # # Overridable (env or `just VAR=… rebuild …`):