代码拉取完成,页面将自动刷新
# Use Maven 3.5 and JDK8
variables:
# This will supress any download for dependencies and plugins or upload messages which would clutter the console log.
# `showDateTime` will show the passed time in milliseconds. You need to specify `--batch-mode` to make this work.
# MAVEN_OPTS: "-Dmaven.repo.local=.m2/repository -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=DEBUG -Dorg.slf4j.simpleLogger.showDateTime=true -Djava.awt.headless=true"
# As of Maven 3.3.0 instead of this you may define these options in `.mvn/maven.config` so the same config is used
# when running from the command line.
# `installAtEnd` and `deployAtEnd`are only effective with recent version of the corresponding plugins.
MAVEN_CLI_OPTS: "--batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true"
# Cache downloaded dependencies and plugins between builds.
# To keep cache across branches add 'key: "$CI_JOB_REF_NAME"'
cache:
key: maven-repository-cache
paths:
- .m2/repository/
# This will only validate and compile stuff and run e.g. maven-enforcer-plugin.
# Because some enforcer rules might check dependency convergence and class duplications
# we use `test-compile` here instead of `validate`, so the correct classpath is picked up.
compile:
stage: build
script:
- 'mvn package -U'
artifacts:
paths:
- target/*.jar
# Run `verify`.
# See https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html
#verify:
# stage: test
# script:
# - 'mvn verify'
deploy-test:
stage: deploy
when: manual
script:
# 复制脚本
- 'scp -P 61111 $CI_PROJECT_DIR/stop.sh devops_gd@172.17.1.3:/home/msg-listen'
- 'scp -P 61111 $CI_PROJECT_DIR/start-test.sh devops_gd@172.17.1.3:/home/msg-listen'
# 修改脚本权限
- 'ssh -n -f devops_gd@172.17.1.3 -p 61111 "chmod o+x /home/msg-listen/*.sh"'
# 复制jar包
- 'scp -P 61111 $CI_PROJECT_DIR/target/msg-listen.jar devops_gd@172.17.1.3:/home/msg-listen'
# 重启进程
- ssh -n -f devops_gd@172.17.1.3 -p 61111 "sh -c 'cd /home/msg-listen && ./stop.sh && source /etc/profile && nohup ./start-test.sh > /dev/null 2>&1 &'"
deploy-prod1:
stage: deploy
when: manual
script:
# 部署第一台
# 复制脚本
- 'scp -P 62222 $CI_PROJECT_DIR/stop.sh root@121.41.119.168:/home/msg-listen'
- 'scp -P 62222 $CI_PROJECT_DIR/start-prod.sh root@121.41.119.168:/home/msg-listen'
# 修改脚本权限
- 'ssh -n -f root@121.41.119.168 -p 62222 "chmod o+x /home/msg-listen/*.sh"'
# 复制jar包
- 'scp -P 62222 $CI_PROJECT_DIR/target/msg-listen.jar root@121.41.119.168:/home/msg-listen'
# 重启进程
- ssh -n -f root@121.41.119.168 -p 62222 "sh -c 'cd /home/msg-listen; ./stop.sh; nohup ./start-prod.sh > /dev/null 2>&1 &'"
deploy-prod2:
stage: deploy
when: manual
script:
# 部署第二台
# 复制脚本
- 'scp -P 62222 $CI_PROJECT_DIR/stop.sh root@47.99.245.213:/home/msg-listen'
- 'scp -P 62222 $CI_PROJECT_DIR/start-prod.sh root@47.99.245.213:/home/msg-listen'
# 修改脚本权限
- 'ssh -n -f root@47.99.245.213 -p 62222 "chmod o+x /home/msg-listen/*.sh"'
# 复制jar包
- 'scp -P 62222 $CI_PROJECT_DIR/target/msg-listen.jar root@47.99.245.213:/home/msg-listen'
# 重启进程
- ssh -n -f root@47.99.245.213 -p 62222 "sh -c 'source /etc/profile; cd /home/msg-listen; ./stop.sh; nohup ./start-prod.sh > /dev/null 2>&1 &'"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。