File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#! /bin/bash
22# Script to extract Artifact Registry regions from image URLs in files and authenticate with docker
3- # Usage: ./docker-auth.sh [ path] [default-regions]
4- # path: optional subdirectory under /home/core/devcontainer
3+ # Usage: ./docker-auth.sh < path> [default-regions]
4+ # path: subdirectory under /home/core/devcontainer (required)
55# default-regions: comma-separated list of regions to always include (defaults to us-central1)
66
77set -o errexit
88set -o nounset
99set -o pipefail
1010set -o xtrace
1111
12- # Use /home/core/devcontainer as prefix for the input
13- DEVCONTAINER_PATH=" /home/core/devcontainer${1: +/ $1 } "
12+ # Validate required parameter
13+ if [ $# -lt 1 ] || [ -z " ${1:- } " ]; then
14+ echo " Error: path parameter is required" >&2
15+ echo " Usage: $0 <path> [default-regions]" >&2
16+ exit 1
17+ fi
18+
19+ DEVCONTAINER_PATH=" /home/core/devcontainer/$1 "
1420
1521# Default regions to always include (comma-separated)
1622DEFAULT_REGIONS=" ${2:- us-central1} "
You can’t perform that action at this time.
0 commit comments