diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fb98b41a2e5c53ea25ac5462725eb1c4d423a1eb..3ec359583e9a884ffb97cd5ed3616c79ebdadc72 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,19 +2,40 @@ # SPDX-License-Identifier: GPL-3.0-or-later stages: + - variables-parser - check-status - trigger pipelines variables: - DUMUX_DOCKER_CI_BRANCH: master IMAGE_REGISTRY_URL: $CI_REGISTRY/dumux-repositories/dumux-docker-ci DUMUX_CI_DUNE_LATEST_RELEASE: "2.9" +variables-parse-job: + image: $IMAGE_REGISTRY_URL/alpine + stage: variables-parser + rules: + - if: $CI_PIPELINE_SOURCE == "pipeline" + when: always + - if: $CI_PIPELINE_SOURCE == "merge_request_event" + when: always + script: + - | + DUMUX_DOCKER_CI_BRANCH=${DUMUX_DOCKER_BRANCH:-master} + UBUNTU_VERSION=${DUMUX_UBUNTU_VERSION:-22.04} + IMAGE_NAME="${DUMUX_DOCKER_CI_BRANCH}_full" + IMAGE="$IMAGE_REGISTRY_URL/${IMAGE_NAME}:dune-$DUMUX_CI_DUNE_LATEST_RELEASE-gcc-ubuntu-$UBUNTU_VERSION" + echo "IMAGE=$IMAGE" | tee -a dynamic-variables.env + echo "UBUNTU_VERSION=$UBUNTU_VERSION" | tee -a dynamic-variables.env + echo "DUMUX_DOCKER_CI_BRANCH=$DUMUX_DOCKER_CI_BRANCH" | tee -a dynamic-variables.env + artifacts: + reports: + dotenv: dynamic-variables.env + # for commits happening on master, we check if there was a successful # pipeline on a related merge request already. If yes, we simply return # to propagate that pipeline status on master. Otherwise, we trigger a new run. check-pipeline-status: - image: $IMAGE_REGISTRY_URL/${DUMUX_DOCKER_CI_BRANCH}_full:dune-2.9-gcc-ubuntu-22.04 + image: $IMAGE_REGISTRY_URL/alpine stage: check-status rules: - if: $CI_PIPELINE_SOURCE == "schedule" @@ -70,9 +91,6 @@ check-pipeline-status: - local: .gitlab-ci/default.yml strategy: depend rules: - - if: $DUMUX_DOCKER_BRANCH != null - variables: - DUMUX_DOCKER_CI_BRANCH: $DUMUX_DOCKER_BRANCH - if: $CI_PIPELINE_SOURCE == "pipeline" when: always - if: $CI_PIPELINE_SOURCE == "merge_request_event" @@ -89,5 +107,4 @@ check-pipeline-status: full-dune-latest-release-gcc: extends: .default-trigger variables: - IMAGE_NAME: "${DUMUX_DOCKER_CI_BRANCH}_full" - IMAGE: "$IMAGE_REGISTRY_URL/$IMAGE_NAME:dune-$DUMUX_CI_DUNE_LATEST_RELEASE-gcc-ubuntu-22.04" + IMAGE: $IMAGE