-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
199 lines (185 loc) · 5.04 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
variables:
BP_OCI_SOURCE: https://github.com/vkp-app/vkp
VERSION: "0.6.0"
BUILD_TAGS: "$VERSION"
KANIKO_TAGS: "$VERSION"
stages:
- build
- bundle
- pre-deploy
- deploy
- release
build apiserver:
stage: build
extends: .build-go
variables:
PROJECT_PATH: apiserver
BUILD_GO_IMPORTPATH: cmd/apiserver
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- changes:
- apiserver/**/*
- .gitlab-ci.yml
- .gitlab/ci/ko.gitlab-ci.yml
build metrics-proxy:
stage: build
extends: .build-go
variables:
PROJECT_PATH: metrics-proxy
BUILD_GO_IMPORTPATH: cmd/metrics
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- changes:
- metrics-proxy/**/*
- .gitlab-ci.yml
- .gitlab/ci/ko.gitlab-ci.yml
build plugin-hooks:
stage: build
extends: .build-go
variables:
PROJECT_PATH: vcluster-plugin-hooks
BUILD_GO_IMPORTPATH: cmd/hooks
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- changes:
- vcluster-plugin-hooks/**/*
- .gitlab-ci.yml
- .gitlab/ci/ko.gitlab-ci.yml
build plugin-sync:
stage: build
extends: .build-go
variables:
PROJECT_PATH: vcluster-plugin-sync
BUILD_GO_IMPORTPATH: cmd/sync
BUILD_IMAGE_PARENT: harbor.dcas.dev/registry.gitlab.com/av1o/helm-install-image:v3-1.25
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- changes:
- vcluster-plugin-sync/**/*
- .gitlab-ci.yml
- .gitlab/ci/ko.gitlab-ci.yml
build web:
stage: build
extends: .build-staticweb
dependencies: []
variables:
PROJECT_PATH: web
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- changes:
- web/**/*
- .gitlab-ci.yml
build web-login:
stage: build
extends: .build-buildkit
dependencies: []
variables:
PROJECT_PATH: web-login
BUILD_ARG_DEX_VERSION: v2.35.3
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- changes:
- web-login/**/*
- .gitlab-ci.yml
build cluster-api-provider-vcluster:
stage: build
extends: .build-buildkit
dependencies: []
variables:
GIT_SUBMODULE_STRATEGY: recursive
PROJECT_PATH: cluster-api-provider-vcluster/cluster-api-provider-vcluster
BUILD_TAGS: "0.1.4-unreleased.1"
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- changes:
- cluster-api-provider-vcluster/**/*
- .gitlab-ci.yml
build operator:
stage: build
extends: .build-go
variables:
PROJECT_PATH: operator
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- changes:
- operator/**/*
- .gitlab-ci.yml
- .gitlab/ci/ko.gitlab-ci.yml
build bundle:
stage: bundle
extends: .kaniko
dependencies:
- prepare bundle
needs:
- prepare bundle
variables:
KANIKO_DOCKERFILE: bundle.Dockerfile
KANIKO_CONTEXT: "$CI_PROJECT_DIR/operator"
before_script:
- export CI_REGISTRY_IMAGE="$CI_REGISTRY_IMAGE/bundle"
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- when: on_success
prepare index:
stage: pre-deploy
dependencies: []
needs:
- job: build bundle
- job: build operator
optional: true
image:
name: quay.io/operator-framework/upstream-registry-builder:v1.26.5
entrypoint: [""]
script:
- |
mkdir -p ~/.docker
echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > ~/.docker/config.json
- cd operator/
- |
if [ -z ${FIRST_RUN+x} ]; then
opm index add --bundles "$CI_REGISTRY_IMAGE/bundle:$VERSION" --from-index "$CI_REGISTRY_IMAGE/index:main" --mode replaces --generate
else
opm index add --bundles "$CI_REGISTRY_IMAGE/bundle:$VERSION" --mode semver-skippatch --generate
fi
artifacts:
paths:
- operator/database/index.db
- operator/index.Dockerfile
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- when: on_success
build index:
stage: deploy
extends: .kaniko
dependencies:
- prepare index
needs:
- prepare index
variables:
KANIKO_DOCKERFILE: index.Dockerfile
KANIKO_CONTEXT: operator
before_script:
- export CI_REGISTRY_IMAGE="$CI_REGISTRY_IMAGE/index"
rules:
- if: "$CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH"
when: never
- when: on_success
include:
- remote: https://gitlab.com/av1o/gitlab-ci-templates/-/raw/v2/build/Go-Base.gitlab-ci.yml
- remote: https://gitlab.com/av1o/gitlab-ci-templates/-/raw/v2/build/BuildKit-Base.gitlab-ci.yml
- remote: https://gitlab.com/av1o/gitlab-ci-templates/-/raw/v2/build/StaticWeb-Base.gitlab-ci.yml
- remote: https://gitlab.com/av1o/gitlab-ci-templates/-/raw/master/build/Kaniko.gitlab-ci.yml
- local: .gitlab/ci/bundle.gitlab-ci.yml
- local: .gitlab/ci/chart.gitlab-ci.yml
- local: .gitlab/ci/release-gitlab.gitlab-ci.yml
- local: .gitlab/ci/release-github.gitlab-ci.yml