diff --git a/dev/preview/previewctl/BUILD.yaml b/dev/preview/previewctl/BUILD.yaml index 0667b1784eb76e..dceadc10d14d47 100644 --- a/dev/preview/previewctl/BUILD.yaml +++ b/dev/preview/previewctl/BUILD.yaml @@ -44,26 +44,26 @@ scripts: description: script: | IMAGE_REPO_BASE=eu.gcr.io/gitpod-core-dev/build - if [[ -n "$INPUT_IMAGE_REPO_BASE" ]]; then - IMAGE_REPO_BASE=$INPUT_IMAGE_REPO_BASE - fi - - echo $IMAGE_REPO_BASE if [[ -z "$INPUT_PREVIEWCTL_HASH" ]]; then - # If a specific hash isn't provided we'll use the latest image off main + # If a specific hash isn't provided we'll use the latest image of main PREVIEWCTL_VERSION=$(\ - gcloud container images list-tags eu.gcr.io/gitpod-core-dev/build/previewctl \ + gcloud container images list-tags $IMAGE_REPO_BASE/previewctl \ --filter="tags:main-gha.*" \ --limit=1 \ --format=json \ | jq --raw-output '.[0].tags[0]' \ ) - PREVIEWCTL_IMAGE="eu.gcr.io/gitpod-core-dev/build/previewctl:$PREVIEWCTL_VERSION" + PREVIEWCTL_IMAGE="$IMAGE_REPO_BASE/previewctl:$PREVIEWCTL_VERSION" else - PREVIEWCTL_IMAGE="eu.gcr.io/gitpod-core-dev/build/previewctl:hash-$INPUT_PREVIEWCTL_HASH" + if [[ -n "$INPUT_IMAGE_REPO_BASE" ]]; then + IMAGE_REPO_BASE=$INPUT_IMAGE_REPO_BASE + fi + PREVIEWCTL_IMAGE="$IMAGE_REPO_BASE/previewctl:hash-$INPUT_PREVIEWCTL_HASH" fi + echo $PREVIEWCTL_IMAGE + echo "Downloading previewctl for $PREVIEWCTL_IMAGE" oci-tool fetch file -o $HOME/bin/previewctl --platform=linux-amd64 "$PREVIEWCTL_IMAGE" app/previewctl chmod +x $HOME/bin/previewctl