This repository was archived by the owner on Jul 12, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathconfig.yml
95 lines (94 loc) · 2.89 KB
/
config.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
default: &default
docker:
- image: choerodon/cifront:0.6.0
version: 2
jobs:
node_build:
<<: *default
working_directory: ~/repo
environment:
CI_PROJECT_PATH: $CIRCLE_PROJECT_REPONAME
steps:
- checkout
- run: |
cd agile && npm install -registry https://nexus.choerodon.com.cn/repository/choerodon-npm/ && cd ..
python ./agile/node_modules/choerodon-front-boot/structure/configAuto.py agile
cd agile
chmod -R 777 node_modules
npm run build
find dist -name '*.js' | xargs sed -i "s/localhost:version/${CIRCLE_TAG}/g"
- persist_to_workspace:
root: .
paths:
- config.yml
- agile/dist
- agile/node_modules/choerodon-front-boot/structure
docker_build:
machine: true
steps:
- checkout
- attach_workspace:
at: .
- run: |
mv agile/dist ./dist
mv agile/node_modules/choerodon-front-boot/structure structure
mv agile/agile-structure agile-structure
sed -i "s/registry.cn-hangzhou.aliyuncs.com\/choerodon-tools/choerodon/g" Dockerfile
docker login -u ${REGISTRY_USER} -p ${REGISTRY_PASSWORD}
docker build --pull -t ${DOCKER_GROUP_NAME}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_TAG} .
docker push ${DOCKER_GROUP_NAME}/${CIRCLE_PROJECT_REPONAME}:${CIRCLE_TAG}
helm_chart_build:
docker:
- image: choerodon/cibase:0.6.0
steps:
- checkout
- run: |
CHART_PATH=`find . -name Chart.yaml`
yq w -i ${CHART_PATH%/*}/Chart.yaml appVersion ${CIRCLE_TAG}
yq w -i ${CHART_PATH%/*}/values.yaml image.repository ${DOCKER_GROUP_NAME}/${CIRCLE_PROJECT_REPONAME}
helm repo add choerodon "${CHART_REPOSITORY}/${CHART_ORGANIZATION}/${CHART_PROJECT}/"
helm push --username ${HELM_USER} --password ${HELM_PASSWORD} ${CHART_PATH%/*} --version ${CIRCLE_TAG} choerodon
workflows:
version: 2
release:
jobs:
- node_build:
context: org-global
filters:
tags:
only: /^.*/
branches:
only:
- /^release-.*$/
- /^hotfix-.*$/
- docker_build:
context: org-global
requires:
- node_build
filters:
tags:
only: /^.*/
branches:
only:
- /^release-.*$/
- /^hotfix-.*$/
- helm_chart_build:
context: org-global
requires:
- node_build
- docker_build
filters:
tags:
only: /^.*/
branches:
only:
- /^release-.*$/
- /^hotfix-.*$/
daily:
jobs:
- node_build:
context: org-global
filters:
branches:
only:
- master