-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
97 lines (80 loc) · 1.57 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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
include:
- project: devopsworks/templates/gitlab-ci
file: code/golang.yml
- project: devopsworks/templates/gitlab-ci
file: code/generic.yml
- project: devopsworks/templates/gitlab-ci
file: docker/generic.yml
- project: devopsworks/templates/gitlab-ci
file: testing/linters.yml
# - template: Code-Quality.gitlab-ci.yml this is broken
- template: Dependency-Scanning.gitlab-ci.yml
- template: SAST.gitlab-ci.yml
image: golang:1.14
cache:
paths:
- .cache
variables:
GOPATH: "$CI_PROJECT_DIR/.cache"
stages:
- lint
- test
- build
- scan
- publish
go:cilint:
extends: .golang_cilint
stage: lint
go:vet:
extends: .golang_vet
stage: lint
docker:lint:
extends: .docker_lint
stage: lint
markdown:lint:
extends: .lint_markdown
stage: lint
yaml:lint:
extends: .lint_yaml
stage: lint
go:test:
extends: .golang_test
stage: test
go:gen:sast:
extends: .code_sast
stage: test
go:coverage:
extends: .golang_coverage
stage: test
go:gen:depscan:
extends: .code_depscan
stage: test
go:docker:
extends: .golang_docker_build
stage: build
go:build:
stage: build
script:
- make release
artifacts:
paths:
- ./bin/*
expire_in: 1 week
# Does not work nor it's necessary with scratch images
# docker:scan:
# stage: scan
# extends: .docker_scan_trivy
release:publish:
stage: publish
image: python:3-slim
before_script:
- pip3 install gitlab-release
script:
- gitlab-release --link-artifact ./bin/*
artifacts:
paths:
- ./bin/*
expire_in: 1 week
only:
- tags