From 8ac5ef27814745b50dd704db3de112d1b847e46d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20Coutable?= Date: Fri, 17 Apr 2020 18:20:52 +0200 Subject: Set default, workflow, and use rules in CI config MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rémy Coutable --- .gitlab-ci.yml | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7975859c..3b166537 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -3,12 +3,27 @@ include: - template: Security/SAST.gitlab-ci.yml - template: Security/Dependency-Scanning.gitlab-ci.yml -image: golang:1.11 - stages: - prepare - test +workflow: + rules: + # For merge requests, create a pipeline. + - if: '$CI_MERGE_REQUEST_IID' + # For `master` branch, create a pipeline (this includes on schedules, pushes, merges, etc.). + - if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH' + # For tags, create a pipeline. + - if: '$CI_COMMIT_TAG' + # For stable, and security branches, create a pipeline. + - if: '$CI_COMMIT_BRANCH =~ /^[\d-]+-stable(-ee)?$/' + - if: '$CI_COMMIT_BRANCH =~ /^security\//' + +default: + image: golang:1.11 + tags: + - gitlab-org + .go-mod-cache: variables: GOPATH: $CI_PROJECT_DIR/.GOPATH @@ -21,6 +36,8 @@ stages: .tests: extends: .go-mod-cache stage: test + tags: + - gitlab-org-docker needs: ['download deps'] script: - echo "Running all tests without daemonizing..." @@ -83,6 +100,8 @@ test:1.14: race: extends: .go-mod-cache stage: test + tags: + - gitlab-org-docker needs: ['download deps'] script: - echo "Running race detector" -- cgit v1.2.3