diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 6ef4e62c9c8365db2b121571e2468a43a5448e2b..daba192922d8d2532e0648291efa048cb478e190 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,6 +3,7 @@ stages: - checkFormat - build - package + - verify - finalise - documentation @@ -548,6 +549,22 @@ BuildOnlineContainerMR: # Cache settings suggested by Copilot: --cache=true --cache-repo=${IMAGE_NAME} --cache-ttl=168h --cache-shared=true --cache-dir=/cache # TODO: Test if these work +# Ensure the container we just build is usable, and not missing any dependencies +VerifyOnlineContainerMR: + stage: verify + only: + - merge_requests + needs: + - BuildOnlineContainerMR + tags: + - docker + variables: + IMAGE_NAME: $CI_REGISTRY_IMAGE/cbm_online + IMAGE_TAG: mr$CI_MERGE_REQUEST_IID + image: $IMAGE_NAME:$IMAGE_TAG + script: + - cbmreco --help + # Create container for master and DC_* branches on merge BuildOnlineContainerBranch: stage: package @@ -569,6 +586,23 @@ BuildOnlineContainerBranch: - echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json - /kaniko/executor --context dir://$CI_PROJECT_DIR --dockerfile $DOCKERFILE --destination $IMAGE_NAME:$IMAGE_TAG +VerifyOnlineContainerBranch: + stage: verify + only: + - master@computing/cbmroot + - nightly_master@computing/cbmroot + - /^DC_.*$/@computing/cbmroot + needs: + - BuildOnlineContainerBranch + tags: + - docker + variables: + IMAGE_NAME: $CI_REGISTRY_IMAGE/cbm_online + IMAGE_TAG: $CI_COMMIT_BRANCH + image: $IMAGE_NAME:$IMAGE_TAG + script: + - cbmreco --help + InformCodeOwners: stage: finalise tags: