diff --git a/manifest-integration.yml b/manifest-integration.yml index 736d10e5361a4658eb20fa2876165e128db2965a..12d4223d8615e2772aaa1270886f6dd555d51ba3 100644 --- a/manifest-integration.yml +++ b/manifest-integration.yml @@ -5,7 +5,7 @@ image: "${CI_IMAGES}/python/3.9:99e363bc5feaa27ff18dbe7731a76ff04d7d0deb" stages: - - prepare + - infrastructure - integrate - merge - build @@ -56,24 +56,36 @@ workflow: - if: $CI_PROJECT_ROOT_NAMESPACE == "SECO-Northern-Europe" && $CI_MERGE_REQUEST_SOURCE_PROJECT_ID == $CI_MERGE_REQUEST_PROJECT_ID +# -------------------------------------------------------------------------------------- +# Common infrastructure settings +# -------------------------------------------------------------------------------------- +.infrastructure: + stage: infrastructure + tags: + - infrastructure + timeout: 5m + image: "${CI_IMAGE_PYTHON}" + needs: [] + variables: + # Include git submodules + GIT_SUBMODULE_STRATEGY: recursive + # --------------------------------------------------------------------------------------- # Stage: prepare # --------------------------------------------------------------------------------------- yamllint: - stage: prepare + extends: .infrastructure rules: - if: $CI_COMMIT_REF_NAME != $MASTER_BRANCH - tags: - - infrastructure - timeout: 2m script: - yamllint -c .gitlab-ci/.yamllint.yml .*.yml # --------------------------------------------------------------------------------------- -# Stage: integrate +# integrate +# Create a commit in the manifest to pull this change # --------------------------------------------------------------------------------------- integrate: - stage: integrate + extends: .infrastructure rules: # We have to make sure that the pipeline runs for the current manifest # master at the time a merge request is created. Otherwise we cannot @@ -81,9 +93,6 @@ integrate: - if: $CI_MERGE_REQUEST_IID # Explicitly allow externally triggered pipelines in every case - if: $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "api" - tags: - - infrastructure - timeout: 5m cache: policy: push script: @@ -111,12 +120,10 @@ integrate: # Stage: merge # --------------------------------------------------------------------------------------- merge: + extends: .infrastructure stage: merge rules: - if: $CI_COMMIT_BRANCH == $MASTER_BRANCH_PROJECT - tags: - - infrastructure - timeout: 5m script: - cd ${CI_PROJECT_DIR} - .gitlab-ci/merge_into_manifest.py @@ -152,15 +159,12 @@ build: # Stage: check # --------------------------------------------------------------------------------------- check: - stage: check + extends: .infrastructure rules: - if: $CI_MERGE_REQUEST_IID # Explicitly allow externally triggered pipelines in every case - if: $CI_PIPELINE_SOURCE == "pipeline" || $CI_PIPELINE_SOURCE == "api" needs: ["integrate"] - tags: - - infrastructure - timeout: 5m script: - cd ${CI_PROJECT_DIR} - if [ -n "${CI_MERGE_REQUEST_IID}" ];then