代码拉取完成,页面将自动刷新
同步操作将从 安惠信息科技(江苏)有限公司/D3Code 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
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
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。