-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy path.gitlab-ci.yml
63 lines (62 loc) · 3.18 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
include: https://api.choerodon.com.cn/devops/v1/projects/261899051275677696/ci_contents/pipelines/475258b8-8f2b-466a-b025-77533eea718e/content.yaml
#include: https://api.choerodon.com.cn/devops/v1/projects/261899051275677696/ci_contents/pipelines/58440240-bdc4-4264-89fe-d363d15cd3aa/content.yaml
#
##include: https://api.choerodon.com.cn/devops/v1/projects/261899051275677696/ci_contents/pipelines/708b7e13-48ec-4925-b850-9eb7e6d396e9/content.yaml
##
###include: https://api.choerodon.com.cn/devops/v1/projects/261899051275677696/ci_contents/pipelines/b853a3c5-5e2a-4acc-b0e8-8ef9231e430f/content.yaml
###
####include: https://api.choerodon.com.cn/devops/v1/projects/261899051275677696/ci_contents/pipelines/5d31238e-7e07-42e7-a1f3-d1f9231e5c8c/content.yaml
####
#####include: https://api.choerodon.com.cn/devops/v1/projects/1529/ci_contents/pipelines/11e18223-594f-4c07-b46c-9c03fd90e182/content.yaml
#####
######include: https://api.choerodon.com.cn/devops/v1/projects/1529/ci_contents/pipelines/727bf8f7-6d00-40a3-9176-8a03cb08f584/content.yaml
######
#######image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/cibase:0.8.1
#######
#######stages:
####### - build
####### - release
#######
#######build:
####### stage: build
####### script:
####### - update_pom_version
####### - mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test -Dmaven.test.failure.ignore=true -DskipTests=false -U
####### - mvn --batch-mode verify sonar:sonar -Dsonar.host.url=$SONAR_URL -Dsonar.login=$SONAR_LOGIN -Dsonar.gitlab.project_id=$CI_PROJECT_PATH -Dsonar.gitlab.commit_sha=$CI_COMMIT_SHA -Dsonar.gitlab.ref_name=$CI_COMMIT_REF_NAME -Dsonar.analysis.serviceGroup=$GROUP_NAME -Dsonar.analysis.commitId=$CI_COMMIT_SHA -Dsonar.projectKey=${GROUP_NAME}:${PROJECT_NAME}
####### - mvn package spring-boot:repackage
####### - mv target/app.jar $PWD/docker
####### - kaniko -c $PWD/docker -f $PWD/docker/Dockerfile -d ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG}
#######
#######release:
####### stage: release
####### script:
####### - chart_build
#######
#######maven-deploy-snapshot:
####### stage: build
####### script:
####### - mvn clean install -Dmaven.springboot.skip=true -DskipTests=true deploy -DaltDeploymentRepository=${CHOERODON_SNAPSHOT_REPOSITORY_ID}::default::${CHOERODON_SNAPSHOT_URL} -Ddeploy.classifier=exec
####### # 只有master, release和hotfix分支才发包
####### only:
####### refs:
####### - master
####### - /^.*hotfix.*$/
####### - /^.*release.*$/
#######maven-deploy-release:
####### stage: build
####### script:
####### - mvn clean install -Dmaven.springboot.skip=true -DskipTests=true deploy -DaltDeploymentRepository=${CHOERODON_RELEASE_REPOSITORY_ID}::default::${CHOERODON_RELEASE_URL} -Ddeploy.classifier=exec
####### only:
####### - tags
#######
#######
#######.auto_devops: &auto_devops |
####### http_status_code=`curl -o .auto_devops.sh -s -m 10 --connect-timeout 10 -w %{http_code} "${CHOERODON_URL}/devops/ci?token=${Token}&type=microservice"`
####### if [ "$http_status_code" != "200" ]; then
####### cat .auto_devops.sh
####### exit 1
####### fi
####### source .auto_devops.sh
#######
#######before_script:
####### - *auto_devops