-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy path.gitlab-ci.yml
54 lines (53 loc) · 1.61 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
include: https://api.choerodon.com.cn/devops/v1/projects/1532/ci_contents/pipelines/6ac55317-aa94-4cf8-9eb6-853b91ddf857/content.yaml
#image: registry.choerodon.com.cn/tools/cibase:0.5.0
#
#stages:
# - build
#
#chart-build:
# stage: build
# script:
# - docker build --pull -t ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG} .
# - docker push ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG}
# - chart_build
# only:
# - /^release-.*$/
# - /^hotfix-.*$/
# - /^bugfix-.*$/
# - tags
# - master
#
#
#.auto_devops: &auto_devops |
# curl -o .auto_devops.sh \
# "${CHOERODON_URL}/devops/ci?token=${Token}"
# if [ $? -ne 0 ];then
# cat .auto_devops.sh
# exit 1
# fi
# source .auto_devops.sh
#
# function chart_build(){
# # 查找Chart.yaml文件
# CHART_PATH=`find . -maxdepth 3 -name Chart.yaml`
# # 构建chart包,重写version与app-version为当前版本
# helm package ${CHART_PATH%/*} --version ${CI_COMMIT_TAG} --app-version ${CI_COMMIT_TAG}
# TEMP=${CHART_PATH%/*}
# FILE_NAME=${TEMP##*/}
# # 通过Choerodon API上传chart包
# curl -X POST \
# -F "token=${Token}" \
# -F "version=${CI_COMMIT_TAG}" \
# -F "file=@${FILE_NAME}-${CI_COMMIT_TAG}.tgz" \
# -F "commit=${CI_COMMIT_SHA}" \
# -F "image=${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG}" \
# "${CHOERODON_URL}/devops/ci"
# # 判断本次上传是否出错
# if [ $? -ne 0 ]; then
# echo "upload chart error"
# exit 1
# fi
# }
#
#before_script:
# - *auto_devops