提交 e0f151fa 编写于 作者: 郝钰

update ci file

上级 2c416642
......@@ -30,12 +30,11 @@ production:
- sshpass -e scp complete/target/spring-boot-complete-0.0.1-SNAPSHOT.jar root@$APP_HOST:/usr/local/apps/hello-world/hello-world.jar
# 部署应用为系统服务
- cat .gitlab-ci/hello-world.service | sshpass -e ssh root@$APP_HOST "cat > ./hello-world.service "
- sshpass -e ssh root@$APP_HOST "[[ -f /etc/systemd/system/hello-world.service ]] || { mv ./hello-world.service /etc/systemd/system/hello-world.service && systemctl daemon-reload && systemctl enable hello-world.service; }"
- sshpass -e ssh root@$APP_HOST "[[ -f /usr/lib/systemd/system/hello-world.service ]] || { mv ./hello-world.service /usr/lib/systemd/system/hello-world.service && systemctl daemon-reload && systemctl enable hello-world.service; }"
- sshpass -e ssh root@$APP_HOST "[[ -f ./hello-world.service ]] && { rm ./hello-world.service; }"
# 重启应用服务
- sshpass -e ssh root@$APP_HOST "systemctl restart hello-world"
# 查看服务状态
- sshpass -e ssh root@$APP_HOST "systemctl status hello-world"
only:
- main
- main
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册