1 Star 0 Fork 73

maxopen/D3Code

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
.gitlab-ci.yml 2.28 KB
一键复制 编辑 原始数据 按行查看 历史
Nottyjay 提交于 2024-01-29 11:47 . 调整gitlab-vue脚本
stages:
- mvn package
- node build
- deploy
#cache:
#paths:
# maven下载三方依赖的缓存目录
#- .m2/repository/
variables:
MAVEN_OPTS: "-Dmaven.repo.local=/root/.m2/repository"
build-job:
stage: mvn package
image: gitlab-maven
tags:
- docker
before_script:
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY"
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- echo -e "Host *\n\tStrictHostKeyChecking no\n\n" > ~/.ssh/config
- rm -rf d3code-ui && mkdir d3code-ui
- git submodule sync --recursive
- git submodule update --init --recursive
script:
# MVN_SETTINGS_XML变量在GitLab的设置=>CI/CD=>变量中定义,值就是整个settings.xml的内容(文本),变量类型设置成了"文件"
- mvn package -s ${MVN_SETTINGS_XML} ${MAVEN_OPTS} -DskipTests
- mkdir -p docker/server/config
- cp d3code-admin/target/d3code-admin.jar docker/server/
- cp -r d3code-admin/target/lib docker/server/
- cp d3code-admin/target/classes/application.yml docker/server/config/
- cp d3code-admin/target/classes/application-prod.yml docker/server/config/
only:
# 只对develop分支运行job
- develop
timeout: 30 min
artifacts:
name: d3code-server
expire_in: 7 days
paths:
- docker/server
vue-build-job:
stage: node build
image: node:16.20.2-buster
tags:
- docker
before_script:
- npm config set registry https://registry.npmmirror.com
script:
- cd d3code-ui
- npm install
- npm run build:prod
- cp -r dist ../docker/admin/dist
- cp nginx.conf ../docker/admin/
only:
# 只对develop分支运行job
- develop
artifacts:
name: d3code-admin
expire_in: 7 days
paths:
- docker/admin
mysql-job:
stage: node build
tags:
- docker
script:
- cp -r ./sql ./docker/
only:
- develop
artifacts:
name: d3code-mysql-sql
expire_in: 7 days
paths:
- docker/sql
develop-d3code:
stage: deploy
image: docker/compose
tags:
- docker-compose
needs:
- job: build-job
artifacts: true
- job: vue-build-job
artifacts: true
- job: mysql-job
artifacts: true
script:
- cd docker
- docker-compose down
- docker-compose up -d
only:
# 只对develop分支运行job
- develop
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/maxopen/d3code.git
[email protected]:maxopen/d3code.git
maxopen
d3code
D3Code
master

搜索帮助