1 Star 0 Fork 7

jerryharbin/hzero-plugin-parent

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.gitlab-ci.yml 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
handadmin 提交于 2020-09-22 22:18 . [AUTO] init project
image: registry.cn-hangzhou.aliyuncs.com/choerodon-tools/cibase:0.5.0
stages:
- mvn-package
maven-test-branches:
stage: mvn-package
script:
- git_merge master
only:
- /^bugfix-.*$/
- /^feature-.*$/
maven-build:
stage: mvn-package
script:
- update_pom_version
- mvn package -U -DskipTests=false
- 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
- mkdir -p /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
- cp target/app.jar /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}/app.jar
docker-build:
stage: docker-build
script:
- docker_build
- chart_build
only:
- master
- tags
- develop
- /^hotfix-.*$/
- /^release-.*$/
.auto_devops: &auto_devops |
curl -o .auto_devops.sh \
"${CHOERODON_URL}/devops/ci?token=${Token}&type=microservice"
if [ $? -ne 0 ];then
cat .auto_devops.sh
exit 1
fi
source .auto_devops.sh
function docker_build(){
cp /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}/app.jar ${1:-"src/main/docker"}/app.jar || true
docker login -u ${DOCKER_USER} -p ${DOCKER_PWD} ${DOCKER_REGISTRY}
docker build --pull -t ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG} ${1:-"src/main/docker"}
docker push ${DOCKER_REGISTRY}/${GROUP_NAME}/${PROJECT_NAME}:${CI_COMMIT_TAG}
rm -rf /cache/${CI_PROJECT_NAME}-${CI_PROJECT_ID}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
}
before_script:
- *auto_devops
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/jerryharbin/hzero-plugin-parent.git
git@gitee.com:jerryharbin/hzero-plugin-parent.git
jerryharbin
hzero-plugin-parent
hzero-plugin-parent
master

搜索帮助