diff options
author | Rémy Coutable <remy@rymai.me> | 2020-04-17 19:20:52 +0300 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2020-04-20 18:04:28 +0300 |
commit | 8ac5ef27814745b50dd704db3de112d1b847e46d (patch) | |
tree | 1837e84019e1779a108ec9fe775a1b3eb3704f71 /.gitlab-ci.yml | |
parent | b372a89c7f446d839094923c906a4925eaf2edf4 (diff) |
Set default, workflow, and use rules in CI config
Signed-off-by: Rémy Coutable <remy@rymai.me>
Diffstat (limited to '.gitlab-ci.yml')
-rw-r--r-- | .gitlab-ci.yml | 23 |
1 files 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" |