-
Notifications
You must be signed in to change notification settings - Fork 33
/
.gitlab-ci.yml
47 lines (47 loc) · 1.02 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
stages:
- prepare
- diff
- lint
- test
prepare-jobs:
image: $CI_REGISTRY_GO/bash:4.4
stage: prepare
tags:
- go
script:
- awk '$1=="go" {print $2}' go.mod
- sed -i "s/from_go_mod_file/$(awk '$1=="go" {print $2}' go.mod)/g" .gitlab-ci.template.yml
- cat .gitlab-ci.template.yml
artifacts:
when: on_success
paths:
- .gitlab-ci.template.yml
expire_in: 1 hour
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'push'
generated:
variables:
PARENT_PIPELINE_ID: $CI_PIPELINE_ID
needs:
- "prepare-jobs"
stage: prepare
trigger:
include:
- artifact: .gitlab-ci.template.yml
job: prepare-jobs
strategy: depend
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_PIPELINE_SOURCE == 'push'
lint-commit-msg:
stage: lint
image:
name: $CI_REGISTRY_GO/commit-check:3.0.0
entrypoint: [""]
tags:
- go
script:
- /check
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'