-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
94 lines (87 loc) · 1.83 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
---
include:
- project: 'rahome/gitlab-ci-templates'
ref: main
file:
- '/templates/Docker.gitlab-ci.yml'
- '/templates/Rust.gitlab-ci.yml'
- '/templates/Yaml.gitlab-ci.yml'
- project: 'rahome/trivy-cache'
ref: main
file:
- '/Trivy.gitlab-ci.yml'
build:cli:
stage: build
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_COMMIT_TAG'
needs: []
extends:
- .rust-build
artifacts:
paths:
- ./target/x86_64-unknown-linux-gnu/release
expire_in: 2 hours
build:docker:
stage: build
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
- if: '$CI_COMMIT_TAG'
needs:
- job: build:cli
extends:
- .docker-registry
variables:
DOCKER_TAG_PREFIX: 'cli-'
DOCKER_FILE: 'docker/cli/Dockerfile'
test:cli:audit:
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
extends:
- .rust-audit
needs: []
test:cli:
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: '$CI_COMMIT_BRANCH'
- if: '$CI_COMMIT_TAG'
needs: []
extends:
- .rust-test
test:docker:
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: '$CI_COMMIT_BRANCH'
needs: []
extends:
- .docker-lint
test:trivy:
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
- if: '$CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH'
needs:
- job: build:docker
artifacts: false
extends:
- .trivy
allow_failure: true
variables:
DOCKER_TAG_PREFIX: 'cli-'
test:yaml:
stage: test
rules:
- if: '$CI_PIPELINE_SOURCE == "schedule"'
when: never
- if: '$CI_COMMIT_BRANCH'
needs: []
extends:
- .yaml-lint