-
Notifications
You must be signed in to change notification settings - Fork 378
/
pipeline.yml
263 lines (261 loc) · 9.77 KB
/
pipeline.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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
version: "1.1"
on:
push:
branches:
- master
- release/*
- next-master
tags:
- v*
stages:
- stage:
- git-checkout:
alias: raw-erda
params:
depth: 1
- git-checkout:
alias: erda-actions
params:
uri: https://erda.cloud/erda/dop/erda-project/erda-actions-mirror
branch: master
depth: 1
- git-checkout:
alias: erda-addons
params:
uri: https://erda.cloud/erda/dop/erda-project/erda-addons-mirror
branch: master
depth: 1
- git-checkout:
alias: erda-actions-enterprise
params:
uri: https://erda.cloud/erda/dop/erda-project/erda-actions-enterprise-mirror
branch: master
depth: 1
- git-checkout:
alias: erda-addons-enterprise
params:
uri: https://erda.cloud/erda/dop/erda-project/erda-addons-enterprise-mirror
branch: master
depth: 1
- git-checkout:
alias: erda-java-extensions
params:
uri: https://erda.cloud/erda/dop/erda-project/erda-java-extensions-mirror
branch: master
depth: 1
- stage:
- custom-script:
alias: erda
image: registry.erda.cloud/erda/gohub:1.0.9
commands:
- cp -a ${{ dirs.raw-erda }}/. .
- make proto-go-in-local
resources:
cpu: 0.5
mem: 2048
- stage:
- extract-repo-version:
params:
git_dir: ${{ dirs.erda }}
- stage:
- custom-script:
alias: build-erda
image: registry.erda.cloud/erda-actions/custom-script:2.1
commands:
- cd ${{ dirs.erda }}
- mkdir -p extensions
- cp -r ${{ dirs.erda-actions }} extensions
- cp -r ${{ dirs.erda-addons }} extensions
- cp -r ${{ dirs.erda-actions-enterprise }} extensions
- cp -r ${{ dirs.erda-addons-enterprise }} extensions
- export ERDA_VERSION=${{ outputs.extract-repo-version.major_minor_version }}
- make prepare
- make buildkit-image-all
loop:
break: task_status == 'Success'
strategy:
max_times: 5
decline_ratio: 2
decline_limit_sec: 60
interval_sec: 5
resources:
cpu: 2
mem: 2048
timeout: 14400
- custom-script:
alias: build-erda-cli
image: registry.erda.cloud/erda-actions/custom-script:2.1
commands:
- cd ${{ dirs.erda }}
- export ERDA_VERSION=${{ outputs.extract-repo-version.major_minor_version }}
- make prepare-cli
- MODULE_PATH=cli make buildkit-image
loop:
break: task_status == 'Success'
strategy:
max_times: 5
decline_ratio: 2
decline_limit_sec: 60
interval_sec: 5
resources:
cpu: 2
mem: 2048
timeout: 7200
- custom-script:
alias: build-cluster-agent
image: registry.erda.cloud/erda-actions/custom-script:2.1
commands:
- cd ${{ dirs.erda }}
- export ERDA_VERSION=${{ outputs.extract-repo-version.major_minor_version }}
- MODULE_PATH=cluster-agent make buildkit-image
loop:
break: task_status == 'Success'
strategy:
max_times: 5
decline_ratio: 2
decline_limit_sec: 60
interval_sec: 5
resources:
cpu: 1
mem: 2048
- custom-script:
alias: build-monitor-injector
image: registry.erda.cloud/erda-actions/custom-script:2.1
commands:
- cd ${{ dirs.erda-java-extensions }}
- mkdir -p /root/.m2 && cp maven-settings-template.xml /root/.m2/settings.xml
- make ci-build-local -e SKIP_TEST=true
- cd ${{ dirs.erda }}
- cp -r ${{ dirs.erda-java-extensions }}/dist/erda-java-agent ./build/java-agent
- MODULE_PATH=monitor/agent-injector make buildkit-image
resources:
cpu: 1
mem: 1024
- custom-script:
alias: build-diagnotor-agent
image: registry.erda.cloud/erda-actions/custom-script:2.1
commands:
- cd ${{ dirs.erda }}
- export ERDA_VERSION=${{ outputs.extract-repo-version.major_minor_version }}
- MODULE_PATH=monitor/diagnotor-agent make buildkit-image
resources:
cpu: 1
mem: 1024
disable: true
- custom-script:
alias: build-erda-cli-linux
image: registry.erda.cloud/erda/erda-base:20240607
description: 运行自定义命令
commands:
- workDir=$(pwd)
- echo $workDir
- cd ${{ dirs.erda }}
- export ERDA_VERSION=${{ outputs.extract-repo-version.major_minor_version }}
- GOPROXY=https://goproxy.cn,direct make prepare-cli
- GOOS=linux GOPROXY=https://goproxy.cn,direct make cli
- cd $workDir
- cp ${{ dirs.erda }}/bin/erda-cli .
- export CLI_VERSION=$(echo ${{ outputs.extract-repo-version.version }} | sed "s/\+.*//g")
- 'echo action meta: version=${CLI_VERSION}'
resources:
cpu: 1
mem: 2048
- custom-script:
alias: build-erda-cli-mac
image: registry.erda.cloud/erda/erda-base:20240607
description: 运行自定义命令
commands:
- workDir=$(pwd)
- echo $workDir
- cd ${{ dirs.erda }}
- export ERDA_VERSION=${{ outputs.extract-repo-version.major_minor_version }}
- GOPROXY=https://goproxy.cn,direct make prepare-cli
- GOOS=darwin GOPROXY=https://goproxy.cn,direct make cli
- cd $workDir
- cp ${{ dirs.erda }}/bin/erda-cli .
- export CLI_VERSION=$(echo ${{ outputs.extract-repo-version.version }} | sed "s/\+.*//g")
- 'echo action meta: version=${CLI_VERSION}'
resources:
cpu: 1
mem: 2048
- stage:
- oss-upload:
alias: upload-linux-erda-cli
description: 上传文件到OSS
version: "1.0"
params:
access_key_id: ((cli_oss_access_key_id))
access_key_secret: ((cli_oss_access_key_secret))
bucket: ((cli_oss_bucket))
endpoint: http://oss-cn-hangzhou.aliyuncs.com
local_path: ${{ dirs.build-erda-cli-linux }}/erda-cli
oss_path: cli/linux/erda-${{ outputs.build-erda-cli-linux.version }}
- oss-upload:
alias: upload-mac-erda-cli
description: 上传文件到OSS
version: "1.0"
params:
access_key_id: ((cli_oss_access_key_id))
access_key_secret: ((cli_oss_access_key_secret))
bucket: ((cli_oss_bucket))
endpoint: http://oss-cn-hangzhou.aliyuncs.com
local_path: ${{ dirs.build-erda-cli-mac }}/erda-cli
oss_path: cli/mac/erda-${{ outputs.build-erda-cli-mac.version }}
- stage:
- erda-mysql-migration:
alias: dryrun-on-mysql80
version: 1.0-80
disable: true
params:
database: ${{ configs.legacy_migration_mysql_database }}
lint_config: .erda/migrations/config.yml
migrationdir: .erda/migrations
mysql_host: ${{ configs.legacy_migration_mysql_host }}
mysql_port: 3306
mysql_username: ${{ configs.legacy_migration_mysql_username }}
mysql_password: ${{ configs.legacy_migration_mysql_password }}
retry_timeout: 150
skip_migration: "true"
skip_pre_migration: true
skip_lint: true
workdir: ${{ dirs.erda }}
- erda-mysql-migration:
alias: dryrun-on-mysql56
version: 1.0-56
params:
database: ${{ configs.legacy_migration_mysql_database }}
lint_config: .erda/migrations/config.yml
migrationdir: .erda/migrations
mysql_host: ${{ configs.legacy_migration_mysql_host }}
mysql_port: 3306
mysql_username: ${{ configs.legacy_migration_mysql_username }}
mysql_password: ${{ configs.legacy_migration_mysql_password }}
retry_timeout: 150
skip_migration: "true"
skip_pre_migration: true
skip_lint: true
workdir: ${{ dirs.erda }}
- stage:
- release:
alias: release-erda
params:
check_diceyml: false
cross_cluster: "true"
dice_yml: ${{ dirs.erda }}/erda.yml
tag_version: ${{ outputs.extract-repo-version.version }}
image:
erda-server: ${{ outputs.build-erda.image }}
cluster-agent: ${{ outputs.build-cluster-agent.image }}
cluster-manager: ${{ outputs.build-erda.image }}
collector: ${{ outputs.build-erda.image }}
collector-agent: ${{ outputs.build-erda.image }}
gittar: ${{ outputs.build-erda.image }}
hepa: ${{ outputs.build-erda.image }}
log-service: ${{ outputs.build-erda.image }}
monitor-agent-injector: ${build-monitor-injector:OUTPUT:image}
monitor: ${{ outputs.build-erda.image }}
orchestrator: ${{ outputs.build-erda.image }}
pipeline: ${{ outputs.build-erda.image }}
streaming: ${{ outputs.build-erda.image }}
ai-proxy: ${{ outputs.build-erda.image }}
erda-cli: ${{ outputs.build-erda-cli.image }}