From bce08af788ba060a2d8e2caff927752671566297 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Mon, 21 Aug 2023 13:08:05 -0700 Subject: [PATCH 1/2] Expand Workbench for GCW to push to multiregion --- .github/actions/build-test-scan-push/action.yaml | 3 +++ workbench-for-google-cloud-workstations/Justfile | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/actions/build-test-scan-push/action.yaml b/.github/actions/build-test-scan-push/action.yaml index 55d64603..d0ff8544 100644 --- a/.github/actions/build-test-scan-push/action.yaml +++ b/.github/actions/build-test-scan-push/action.yaml @@ -86,6 +86,9 @@ runs: run: | if [ ! -z "${{ inputs.gcp-json }}" ]; then gcloud auth configure-docker -q us-central1-docker.pkg.dev + gcloud auth configure-docker -q us-docker.pkg.dev + gcloud auth configure-docker -q asia-docker.pkg.dev + gcloud auth configure-docker -q europe-docker.pkg.dev fi - name: Build diff --git a/workbench-for-google-cloud-workstations/Justfile b/workbench-for-google-cloud-workstations/Justfile index 060f4f47..f95ecf08 100644 --- a/workbench-for-google-cloud-workstations/Justfile +++ b/workbench-for-google-cloud-workstations/Justfile @@ -31,7 +31,13 @@ get-build-args: get-build-tags: #!/usr/bin/env bash echo ${IMAGE_REGISTRY_NAME}:${RSW_TAG_VERSION},\ - ${IMAGE_REGISTRY_NAME}:latest + ${IMAGE_REGISTRY_NAME}:latest,\ + us-docker.pkg.dev/posit-images/cloud-workstations/workbench:${RSW_TAG_VERSION},\ + us-docker.pkg.dev/posit-images/cloud-workstations/workbench:latest,\ + asia-docker.pkg.dev/posit-images/cloud-workstations/workbench:${RSW_TAG_VERSION},\ + asia-docker.pkg.dev/posit-images/cloud-workstations/workbench:latest,\ + europe-docker.pkg.dev/posit-images/cloud-workstations/workbench:${RSW_TAG_VERSION},\ + europe-docker.pkg.dev/posit-images/cloud-workstations/workbench:latest # Build Workbench image - just build 2022.07.2+576.pro12 rstudio/rstudio-workbench-gcw:2022.07.2 build *TAGS="": From 8042520f2bb049e99420f0d27a80b055fb3bd993 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Mon, 21 Aug 2023 13:30:26 -0700 Subject: [PATCH 2/2] Loop through regions for build tags --- .../Justfile | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/workbench-for-google-cloud-workstations/Justfile b/workbench-for-google-cloud-workstations/Justfile index f95ecf08..fc4fd658 100644 --- a/workbench-for-google-cloud-workstations/Justfile +++ b/workbench-for-google-cloud-workstations/Justfile @@ -30,14 +30,15 @@ get-build-args: get-build-tags: #!/usr/bin/env bash - echo ${IMAGE_REGISTRY_NAME}:${RSW_TAG_VERSION},\ - ${IMAGE_REGISTRY_NAME}:latest,\ - us-docker.pkg.dev/posit-images/cloud-workstations/workbench:${RSW_TAG_VERSION},\ - us-docker.pkg.dev/posit-images/cloud-workstations/workbench:latest,\ - asia-docker.pkg.dev/posit-images/cloud-workstations/workbench:${RSW_TAG_VERSION},\ - asia-docker.pkg.dev/posit-images/cloud-workstations/workbench:latest,\ - europe-docker.pkg.dev/posit-images/cloud-workstations/workbench:${RSW_TAG_VERSION},\ - europe-docker.pkg.dev/posit-images/cloud-workstations/workbench:latest + set -eu + regions=("us" "asia" "europe" "us-central-1") + tag_array=() + for region in "${regions[@]}"; do + tag_array+=("$region-docker.pkg.dev/posit-images/cloud-workstations/workbench:${RSW_TAG_VERSION}") + tag_array+=("$region-docker.pkg.dev/posit-images/cloud-workstations/workbench:latest") + done + IFS="," + echo "${tag_array[*]}" # Build Workbench image - just build 2022.07.2+576.pro12 rstudio/rstudio-workbench-gcw:2022.07.2 build *TAGS="":