Skip to content
Snippets Groups Projects
Commit 8bfa443a authored by Jonas Höppner's avatar Jonas Höppner
Browse files

CI: Use only one stage for integration to allow parallel execution

parent bb392f50
No related branches found
No related tags found
1 merge request!101CI: Create pipeline to deploy changes in gitlab-ci to all subprojects, include all CI implementations from there.
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment