diff --git a/documentation/chapters/templates/common/common-ci-workflow.adoc b/documentation/chapters/templates/common/common-ci-workflow.adoc new file mode 100644 index 0000000..c515acb --- /dev/null +++ b/documentation/chapters/templates/common/common-ci-workflow.adoc @@ -0,0 +1,12 @@ +:gitlab-ci-file: common/common-ci-workflow.gitlab-ci.yml + +[[Common-Workflow]] +== Common Workflow + +Within the `{gitlab-ci-file}` file we provide a common workflow. +This workflow runs all pipelines (including branch pipelines, tag pipelines, merge request pipelines, triggerd pipelines, shedules-pipelines ...). +However, it prevents that a branch pipeline starts, when there is an open merge request. +To use our common workflow, just import the template. + +:template: {gitlab-ci-file} +include::../../../template-printer.adoc[] \ No newline at end of file diff --git a/documentation/document.adoc b/documentation/document.adoc index d050990..4df29c1 100644 --- a/documentation/document.adoc +++ b/documentation/document.adoc @@ -35,6 +35,7 @@ toc::[] include::generalInformation.adoc[leveloffset=1] include::chapters/templates/common/common-ci-variablen.adoc[leveloffset=1] +include::chapters/templates/common/common-ci-workflow.adoc[leveloffset=1] == Contribution diff --git a/templates/common/common-ci-workflow.gitlab-ci.yml b/templates/common/common-ci-workflow.gitlab-ci.yml new file mode 100644 index 0000000..2082b01 --- /dev/null +++ b/templates/common/common-ci-workflow.gitlab-ci.yml @@ -0,0 +1,6 @@ +workflow: + rules: + # Prevent branch pipelines when there is an open merge request + - if: $CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS && $CI_PIPELINE_SOURCE == "push" + when: never + - when: always