2 Star 2 Fork 0

Texous/WebParsingServer

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.gitlab-ci.yml 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
Showa.L 提交于 2020-03-13 10:12 . 拆分服务首次提交暂存
# 定义三个阶段
stages:
- build
- package
- deploy-k8s
# 定义个变量, 指定maven下载的jar包存放的位置
variables:
# MAVEN_OPTS: "-Dmaven.repo.local=/root/.m2/repository"
APP_RELEASE_NAME: $CI_PROJECT_NAME
APP_REGISTRY_IMAGE: $CI_REGISTRY_IMAGE:$CI_COMMIT_REF_SLUG
#services:
# - name: docker:dind
build:
stage: build
image: maven:3-jdk-8
tags:
- build-runner
script:
- cd web-parsing-engine
- mvn clean package -e -DskipTests
- cd ../web-parsing-book
- mvn clean package -e -DskipTests
- cd ../
artifacts:
expire_in: 1h
paths:
- web-parsing-engine/target/*.jar
- web-parsing-engine/target/classes
- web-parsing-book/target/*.jar
- web-parsing-book/target/classes
package:
stage: package
image: docker:latest
tags:
- build-runner
script:
- echo Build Docker image $APP_REGISTRY_IMAGE
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- cd ./web-parsing-engine && docker build -t $CI_REGISTRY_IMAGE/web-parsing-engine:$CI_COMMIT_REF_SLUG .
- docker push $CI_REGISTRY_IMAGE/web-parsing-engine:$CI_COMMIT_REF_SLUG
- cd ../web-parsing-book && docker build -t $CI_REGISTRY_IMAGE/web-parsing-book:$CI_COMMIT_REF_SLUG .
- docker push $CI_REGISTRY_IMAGE/web-parsing-book:$CI_COMMIT_REF_SLUG
only:
- master
deploy-k8s:
stage: deploy-k8s
image: alpine/helm:3.0.2
tags:
- cluster-k8s-runner
dependencies: []
script:
- echo Deploy Helm release $APP_RELEASE_NAME web-parsing-engine
- helm version
- |
helm upgrade \
--install \
--namespace=web-servers \
--set image.tag=$CI_COMMIT_REF_SLUG \
web-parsing-engine \
./web-parsing-engine/charts/web-parsing-engine
- echo Deploy Helm release $APP_RELEASE_NAME web-parsing-book
- |
helm upgrade \
--install \
--namespace=web-servers \
--set image.tag=$CI_COMMIT_REF_SLUG \
web-parsing-book \
./web-parsing-book/charts/web-parsing-book
only:
- master
when: manual
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/texousliu/WebParsingServer.git
git@gitee.com:texousliu/WebParsingServer.git
texousliu
WebParsingServer
WebParsingServer
master

搜索帮助

0d507c66 1850385 C8b1a773 1850385