Jenkins builds Gradle-based Springboot project CI mining pits (with jar deployment)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.