Tried a bunch of plug-ins, and finally with publish over SSH
Jenkins basic configuration Not much to say, is to configure a git storage, configure the Gradle execute command
Cleanbootrepackage
After executing the Send build artifacts over SSH
Configure the appropriate server in advance
Send build artifacts over SSH
The trouble is the execution of restart.sh scripts, always a variety of wonderful problems, the end result is as follows
#/bin/Bashpid=`PS-ef |grepSpp.jar |grep-Vgrep|awk '{print $}'`if[-N"$pid" ] Then Kill-9$pidfiJava-jar/data1/javaapp/smartpushplatform/spp.jar--server.port=30001> Console.log &
This basically can be done start up, and can be launched normally
The compilation log is as follows:
[Gradle]-launching build. [Smartpushplatform] $/usr/share/gradle/bin/gradle clean bootrepackagestarting a gradle Daemon (subsequent builds would be Faster): Clean:compilejavanote:/var/lib/jenkins/workspace/smartpushplatform/src/main/java/com/gridsum/techpub/ Legal/smartpush/service/tagservice.java uses unchecked or unsafe operations. Note:recompile with-xlint:unchecked for details.:p RocessResources:classes:findMainClass:jar:bootRepackageBUILD Successful in 7S6 actionable tasks:6 executedbuild Step ' Invoke Gradle script ' changed build result to Successssh:connec Ting from host [gs-server-3602]ssh:connecting with configuration [10.202.81.26] ... Ssh:exec:stdout/stderr from command [CD/DATA1/JAVAAPP/SMARTPUSHPLATFORMMV Smartpushplatform-1.1.jar Spp.jarsh RESTART.SH] ... SSH:EXEC:completed after msssh:disconnecting configuration [10.202.81.26] ... Ssh:transferred 1 file (s) finished:success
Jenkins builds Gradle-based Springboot project CI mining pits (with jar deployment)