forked from erda-project/erda-ui
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pipeline.yml
128 lines (125 loc) · 4.33 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
version: "1.1"
on:
push:
branches:
- master
- release/*
tags:
- v*
cron: 0 0 10,13,16,19,23 * * ?
stages:
- stage:
- git-checkout:
alias: erda-ui
description: 代码仓库克隆
version: "1.0"
params:
branch: ((gittar.branch))
depth: 1
uri: https://erda.cloud/erda/dop/erda-project/erda-ui
- git-checkout:
alias: erda-ui-enterprise
description: 代码仓库克隆
version: "1.0"
params:
branch: ((gittar.branch))
depth: 1
uri: https://erda.cloud/erda/dop/erda-project/erda-ui-enterprise
- stage:
- extract-repo-version:
alias: ui-version
description: Extract repo version in git dir
params:
git_dir: ${{ dirs.erda-ui }}
- extract-repo-version:
alias: ui-enterprise-version
description: Extract repo version in git dir
params:
git_dir: ${{ dirs.erda-ui-enterprise }}
- stage:
- js-build:
alias: build-erda-ui
description: 针对 nodejs 工程的编译打包任务
version: "1.0"
params:
build_cmd:
- cd ${{ dirs.erda-ui }}/shell && npm run extra-logic
- cd ${{ dirs.erda-ui }}
- npm i -g --force [email protected]
- pnpm i --frozen-lockfile --no-optional --unsafe-perm
- pnpm run build-online
- cp -r ${{ dirs.erda-ui }}/{public,scheduler} $WORKDIR
node_version: 14
resources:
cpu: 0.5
mem: 6144
caches:
- key: '{{basePath}}/build-cache-community/{{endPath}}'
path: ${{ dirs.erda-ui }}/node_modules
- js-build:
alias: build-erda-ui-enterprise
description: 针对 nodejs 工程的编译打包任务
version: "1.0"
params:
build_cmd:
- cd ${{ dirs.erda-ui-enterprise }}/admin && npm i
- npm run build
- cp -r ${{ dirs.erda-ui-enterprise }}/{public,server} $WORKDIR
node_version: 14
resources:
cpu: 0.5
mem: 2048
caches:
- key: '{{basePath}}/build-cache-enterprise/{{endPath}}'
path: ${{ dirs.erda-ui }}/node_modules
- stage:
- dockerfile:
alias: build-erda-ui-image
description: 针对自定义 dockerfile 打包,产出可运行镜像
version: "1.0"
params:
image:
name: ui
tag: ${{ outputs.ui-version.image_tag }}
path: ${{ dirs.erda-ui }}/Dockerfile
registry:
password: ${{ configs.docker_registry_password }}
url: ${{ configs.docker_registry }}
username: ${{ configs.docker_registry_username }}
workdir: ${{ dirs.build-erda-ui }}
resources:
cpu: 0.5
mem: 2048
- dockerfile:
alias: build-erda-ui-enterprise-image
description: 针对自定义 dockerfile 打包,产出可运行镜像
version: "1.0"
params:
image:
name: ui-enterprise
tag: ${{ outputs.ui-enterprise-version.image_tag }}
path: ${{ dirs.erda-ui-enterprise }}/Dockerfile
registry:
password: ${{ configs.docker_registry_password }}
url: ${{ configs.docker_registry }}
username: ${{ configs.docker_registry_username }}
workdir: ${{ dirs.build-erda-ui-enterprise }}
resources:
cpu: 0.5
mem: 2048
- stage:
- release:
alias: release-ui
description: 用于打包完成时,向dicehub 提交完整可部署的dice.yml。用户若没在pipeline.yml里定义该action,CI会自动在pipeline.yml里插入该action
version: "1.0"
params:
check_diceyml: false
cross_cluster: "true"
tag_version: ${{ outputs.ui-version.version }}
dice_yml: ${{ dirs.erda-ui }}/erda.yml
image:
enterprise-ui: ${{ outputs.build-erda-ui-enterprise-image.image }}
ui: ${{ outputs.build-erda-ui-image.image }}
resources:
cpu: 0.5
mem: 512