目标:
写一个自动脚本,编译本地工程,并自动发布到服务器上的:
bat文件:
cd project_dir4
call mvn clean
call mvn package
call "C:\Program Files (x86)\WinSCP\PuTTY\pageant.exe" D:\linuxKey\sh-1.ppk //private key
call "C:\Program Files (x86)\WinSCP\WinSCP.exe" /console /script=d:\winscp_script\44\deploy44.txt /log=d:\aa.log
deploy44.txt:
option batch abort
option confirm off
# Connect using a password
# open 用户名:密码@主机
# Connect
open scp://root:123@10.1.0.44 -privatekey=D:\linuxKey\sh-1.ppk
cd /opt/hoda-setup/hoda-server
call ./clear.sh // shell script delete old project war package
option transfer binary
put D:\HODA\ml_new\server\vanguard-parent\vanguard-webapp\target\vanguard-webapp.war
call ./deploy.sh // shell script restart your app server
close