Jenkins 自动化部署 持续集成

本文介绍如何通过SSH在远程服务器上部署CMS应用,包括文件传输、进程杀除及启动新进程等步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

螢幕快照 2017-11-18 22.56.06.png

Source files

build/libs/cms-0.0.1-SNAPSHOT.jar

Help for feature: Source files
Files to upload to a server.

The string is a comma separated list of includes for an Ant fileset eg. '*/.jar' (see Patterns in the Ant manual).
The base directory for this fileset is the workspace.

Remote directory

/usr/local/cms

Help for feature: Remote directory
Optional destination folder.

This folder will be below the one in the global configuration, if present.
The folder will be created if does not exist.

Exec command

set pid = $(ps -ef|grep java|grep kotlin|awk '{print $2}')
if (test $pid)
then
kill -9 $pid
fi
cd /usr/local/cms
nohup java -jar cms-0.0.1-SNAPSHOT.jar &

A command to execute on the remote server

This command will be executed on the remote server after any files are transferred.
The SSH Transfer Set must include either a Source Files pattern, an Exec command, or both. If both are present, the files are transferred before the command is executed. If you want to Exec before the files are transferred, use 2 Transfer Sets and move the Exec command before the Transfer set that includes a Source files pattern.


image.png
image.png
fuser -k 8010/tcp
cd /usr/local/cms
nohup java -jar cms-0.0.1-SNAPSHOT.jar &
image.png
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值