1 Star 0 Fork 0

会痛的石头/msglisten

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
.gitlab-ci.yml 3.41 KB
一键复制 编辑 原始数据 按行查看 历史
liuweiwei 提交于 2021-06-25 16:58 . 部署脚本修改
# 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 &'"
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yuanzhishang/msglisten.git
git@gitee.com:yuanzhishang/msglisten.git
yuanzhishang
msglisten
msglisten
master

搜索帮助