From 929530b7ec3e001c94c980fa73bffb5c17d5074b Mon Sep 17 00:00:00 2001 From: Zeitsperre <10819524+Zeitsperre@users.noreply.github.com> Date: Tue, 15 Aug 2023 16:34:38 -0400 Subject: [PATCH] BASE_IMAGE_TAG must always be supplied to dagger-pipeline.py --- .github/workflows/dagger-docker.yml | 7 ++++++- ci/dagger-pipeline.py | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dagger-docker.yml b/.github/workflows/dagger-docker.yml index 7b689c14..81675fc6 100644 --- a/.github/workflows/dagger-docker.yml +++ b/.github/workflows/dagger-docker.yml @@ -11,7 +11,6 @@ on: BASE_IMAGE_TAG: description: 'Image tag to use for the Docker image' required: true - default: 'latest' PAVICS_HOST: description: 'Pavics URL to test against' required: true @@ -21,6 +20,8 @@ on: required: true default: 'https://github.com/Ouranosinc/PAVICS-e2e-workflow-tests/raw/master/notebooks/output-sanitize.cfg' +env: + BASE_IMAGE_TAG: 230601 jobs: lint: @@ -58,6 +59,10 @@ jobs: with: python-version: ${{ matrix.python-version }} - name: Set Environment Variables + if: ${{ github.event_name != 'workflow_dispatch' }} + run: | + echo "BASE_IMAGE_TAG=${{ env.BASE_IMAGE_TAG }}" >> $GITHUB_ENV + - name: Set Environment Variables (Workflow Dispatch) if: ${{ github.event_name == 'workflow_dispatch' }} run: | echo "BASE_IMAGE_TAG=${{ github.event.inputs.image_tag }}" >> $GITHUB_ENV diff --git a/ci/dagger-pipeline.py b/ci/dagger-pipeline.py index 63091933..949e6cff 100644 --- a/ci/dagger-pipeline.py +++ b/ci/dagger-pipeline.py @@ -16,7 +16,7 @@ ) -BASE_IMAGE_TAG = os.getenv("BASE_IMAGE_TAG", "latest") +BASE_IMAGE_TAG = os.getenv("BASE_IMAGE_TAG") PAVICS_HOST = os.getenv("PAVICS_HOST", "https://pavics.ouranos.ca") SANITIZE_FILE_URL = os.getenv( "SANITIZE_FILE_URL", @@ -30,6 +30,9 @@ async def main(): log_output=sys.stderr, workdir=Path(__file__).parent.parent.as_posix() ) ) as client: + if not BASE_IMAGE_TAG: + raise ValueError("BASE_IMAGE_TAG environment variable is not set.") + sources = await ( # pull container client.container().from_(f"pavics/workflow-tests:{BASE_IMAGE_TAG}")