From cbfd2e2dfef4fd186af34fcf70619df606476bb7 Mon Sep 17 00:00:00 2001 From: Erik Vattekar Date: Fri, 14 Jun 2024 11:17:40 +0200 Subject: [PATCH] gcloud artifacts list command returns list of one element with newest version of gcloud sdk. Pinning gcloud sdk version in workflow to latest (480.0.0) and altering command to extract the image tag --- .github/workflows/tests.yaml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 4f78e24..6d35617 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -59,6 +59,10 @@ jobs: kubectl create secret generic github-app-secret --from-literal=test=test kubectl create cm ca-bundle-pem --from-literal=test=test kubectl apply -f ./tests-integration/dbt/k8s_resources + - name: Set up Cloud SDK + uses: google-github-actions/setup-gcloud@v2 + with: + version: "480.0.0" - name: Setup Airflow env: AIRFLOW_CONN_SQLITE_DEFAULT: sqlite://?mode=ro @@ -69,12 +73,12 @@ jobs: # envs echo "AIRFLOW__CORE__DAGS_FOLDER=$(pwd)/tests-integration" >> $GITHUB_ENV - gitsync_tag=$(gcloud artifacts docker images list "$GIT_SYNC_IMAGE" --include-tags --sort-by=~Update_Time --limit=1 --format=json | jq -rc '.[0].tags') + gitsync_tag=$(gcloud artifacts docker images list "$GIT_SYNC_IMAGE" --include-tags --sort-by=~Update_Time --limit=1 --format=json | jq -rc '.[0].tags.[0]') echo $gitsync_tag echo "CLONE_REPO_IMAGE=ghcr.io/navikt/knada-git-sync/git-sync:$gitsync_tag" >> $GITHUB_ENV echo $CLONE_REPO_IMAGE - dataverk_airflow_tag=$(gcloud artifacts docker images list "$DATAVERK_AIRFLOW_IMAGE_BASE_URL-${{ matrix.version}}" --include-tags --sort-by=~Update_Time --limit=1 --format=json | jq -rc '.[0].tags') + dataverk_airflow_tag=$(gcloud artifacts docker images list "$DATAVERK_AIRFLOW_IMAGE_BASE_URL-${{ matrix.version}}" --include-tags --sort-by=~Update_Time --limit=1 --format=json | jq -rc '.[0].tags.[0]') echo "KNADA_AIRFLOW_OPERATOR_IMAGE=ghcr.io/navikt/knada-images/dataverk-airflow-python-${{ matrix.version }}:$dataverk_airflow_tag" >> $GITHUB_ENV - name: Run tests Knada env: