Support registry token for VPN image pulls
Build & Deploy / Build & Push Docker Image (push) Successful in 2m50s
Test / Type Check (all packages) (push) Successful in 50s
Build & Deploy / Deploy to VPS (push) Successful in 4s
Test / API Unit Tests (push) Successful in 45s
Test / Homepage Unit Tests (push) Successful in 42s
Test / Storefront Unit Tests (push) Successful in 40s
Test / Admin Unit Tests (push) Successful in 41s
Test / Dashboard Unit Tests (push) Successful in 40s
Test / API Integration Tests (push) Successful in 59s

This commit is contained in:
root
2026-07-02 11:49:58 -04:00
parent 0394f0ea2a
commit 1fd1ddf3f2
6 changed files with 38 additions and 14 deletions
+13 -2
View File
@@ -111,10 +111,16 @@ load_prod_env_exports() {
IMAGE_ARCHIVE_REQUIRED \
REGISTRY_HOST \
REGISTRY_USER \
REGISTRY_PASSWORD
REGISTRY_PASSWORD \
REGISTRY_TOKEN
do
export_env_value_if_unset "${key}"
done
if [[ -z "${REGISTRY_PASSWORD:-}" && -n "${REGISTRY_TOKEN:-}" ]]; then
REGISTRY_PASSWORD="${REGISTRY_TOKEN}"
export REGISTRY_PASSWORD
fi
}
validate_prod_env_file() {
@@ -239,6 +245,11 @@ require_release_image() {
}
login_registry_if_configured() {
if [[ -z "${REGISTRY_PASSWORD:-}" && -n "${REGISTRY_TOKEN:-}" ]]; then
REGISTRY_PASSWORD="${REGISTRY_TOKEN}"
export REGISTRY_PASSWORD
fi
if [[ "${IMAGE_ARCHIVE_REQUIRED:-false}" == "true" || "${IMAGE_ARCHIVE_REQUIRED:-0}" == "1" ]]; then
echo "IMAGE_ARCHIVE_REQUIRED is enabled; skipping docker login."
return 0
@@ -267,7 +278,7 @@ login_registry_if_configured() {
fi
if [[ -z "${REGISTRY_HOST:-}" || -z "${REGISTRY_USER:-}" || -z "${REGISTRY_PASSWORD:-}" ]]; then
echo "REGISTRY_HOST, REGISTRY_USER, and REGISTRY_PASSWORD are all required when registry credentials are configured." >&2
echo "REGISTRY_HOST, REGISTRY_USER, and REGISTRY_PASSWORD or REGISTRY_TOKEN are required when registry credentials are configured." >&2
exit 1
fi
+5 -5
View File
@@ -55,19 +55,19 @@ prompt_registry_password_if_needed() {
return 0
fi
if [[ -n "${REGISTRY_PASSWORD:-}" ]]; then
if [[ -n "${REGISTRY_PASSWORD:-}" || -n "${REGISTRY_TOKEN:-}" ]]; then
return 0
fi
if [[ ! -t 0 ]]; then
echo "REGISTRY_PASSWORD is not set and no interactive terminal is available for a prompt." >&2
echo "REGISTRY_TOKEN or REGISTRY_PASSWORD is not set and no interactive terminal is available for a prompt." >&2
exit 1
fi
printf 'Registry password for %s@%s: ' "${REGISTRY_USER}" "${REGISTRY_HOST}" >&2
read -r -s REGISTRY_PASSWORD
printf 'Registry token for %s@%s: ' "${REGISTRY_USER}" "${REGISTRY_HOST}" >&2
read -r -s REGISTRY_TOKEN
printf '\n' >&2
export REGISTRY_PASSWORD
export REGISTRY_TOKEN
}
echo "Starting production services from pulled image ${APP_IMAGE}:${APP_VERSION}"