1 Star 2 Fork 5

Choerodon / manager-service

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
.gitlab-ci.yml 4.93 KB
一键复制 编辑 原始数据 按行查看 历史
setzero 提交于 2020-03-05 11:28 . [IMP]允许打tag跑CI
image: registry.cn-shanghai.aliyuncs.com/c7n/cibase:0.9.1
stages:
- build
- release
build front:
stage: build
script:
- npm install --registry ${NPM_REPO} --sass-binary-site=http://npm.taobao.org/mirrors/node-sass
- chmod -R 755 node_modules
- npm run compile
- echo "//${NPM_REGISTRY}:_authToken=${NPM_TOKEN}">.npmrc
- npm publish --registry https://nexus.choerodon.com.cn/repository/private-npm/
- curl -sX POST -F token=${FRONT_REPOSITORY_TOKEN} -F ref=${REF_NAME} https://code.choerodon.com.cn/api/v4/projects/7909/trigger/pipeline
except:
changes:
- pom.xml
- src/**/*
- docker/**/*
- chart/**/*
- init-database.sh
- .circleci/**/*
- .gitignore
- .github/**/*
- .gitlab-ci.yml
- "*.md"
variables:
- $CI_COMMIT_MESSAGE =~ /combine/
tag front:
stage: build
script:
- npm install --registry ${NPM_REPO} --sass-binary-site=http://npm.taobao.org/mirrors/node-sass
- chmod -R 755 node_modules
- npm run compile
- echo "//${NPM_REGISTRY}:_authToken=${NPM_TOKEN}">.npmrc
- npm publish --registry https://nexus.choerodon.com.cn/repository/private-npm/
only:
- tags
build backend:
stage: build
script:
- update_pom_version
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test -Dmaven.test.failure.ignore=true -DskipTests=true -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}
except:
changes:
- .eslintrc.json
- .stylelintrc.json
- package.json
- react/**/*
- tsconfig.json
- .gitignore
- .github/**/*
- .gitlab-ci.yml
- "*.md"
variables:
- $CI_COMMIT_MESSAGE =~ /combine/
tag backend:
stage: build
script:
- update_pom_version
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test -Dmaven.test.failure.ignore=true -DskipTests=true -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}
only:
- tags
build combine:
stage: build
script:
- update_pom_version
- mvn clean org.jacoco:jacoco-maven-plugin:prepare-agent test -Dmaven.test.failure.ignore=true -DskipTests=true -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 docker
- npm install --registry ${NPM_REPO} --sass-binary-site=http://npm.taobao.org/mirrors/node-sass
- chmod -R 755 node_modules
- npm run dist
- mv src/main/resources/lib/dist docker
- kaniko -c $PWD/docker -f $PWD/docker/Dockerfile-combine -d ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG}
only:
variables:
- $CI_COMMIT_MESSAGE =~ /combine/
release backend:
stage: release
script:
- chart_build
except:
changes:
- .eslintrc.json
- .stylelintrc.json
- package.json
- react/**/*
- tsconfig.json
- .gitignore
- .github/**/*
- .gitlab-ci.yml
- "*.md"
variables:
- $CI_COMMIT_MESSAGE =~ /combine/
release combine:
stage: release
script:
- chart_build
only:
variables:
- $CI_COMMIT_MESSAGE =~ /combine/
tag release:
stage: release
script:
- chart_build
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
Java
1
https://gitee.com/choerodon/manager-service.git
git@gitee.com:choerodon/manager-service.git
choerodon
manager-service
manager-service
master

搜索帮助