My goal is to setup a CI/DI pipe line in Jenkins for Java Spring Boot project. I am using maven and git. I am able to automate the compile, test and package, after any push to the GitHub. But I am unable to automate the deployment by "java -jar <path/appName>" command. I have searched, they are many solutions.
To run run the application in the Background I am tmux
. But I am unable to kill current java application. I have running other Java applications. Some of the solutions are in the intermate is that jus kill the all java process.
What I need to do:
have to do compile, test, package
have to kill the current running java application. my running application command is </var/lib/jenkins/workspace/app-package/target/app-0.0.1-SNAPSHOT.jar>
. How to kill this program?
Is there any to kill it by command name? I can find out the job id by command name in terminal.
have to rerun the </var/lib/jenkins/workspace/app-package/target/app-0.0.1-SNAPSHOT.jar>
command in Background. want to avoid tmux
.
I am able to do task One
but totally with stacked with task Two
.
For task Three
, I am unable to run the process in Background by tmux
from Jenkins. But unable to use tmux
from Jenkins.
If i run ps -A | grep java
Out Put:
23053 ? 00:21:08 java
716890 pts/2 00:00:52 java
It is showing two process, in automated situation, how it will be determined which one have to kill? Which process is running by the command </var/lib/jenkins/workspace/app-package/target/app-0.0.1-SNAPSHOT.jar>
?
question from:
https://stackoverflow.com/questions/65641123/how-to-stop-running-java-process-and-rerun-it-from-jenkins-in-centos 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…