I got a little project assigned to me with a particular use case and a very short time window. I have to run Jenkins on a Windows 2019 Server VM instance in Google Cloud, clone a spring boot/Maven application from GitHub, build, test, and run the application. This is my first time working with Jenkins and spring boot/Maven so I am kinda stuck in how to progress.
I have a Jenkinsfile in my repo and have succesfully cloned, built, tested, and ran the application, the only problem is during the "run" stage of the build it runs indefinitely until I manually abort the build. Is there a way to finish the pipeline build but leave the application running? Below is my Jenkinsfile.
pipeline {
agent any
stages {
stage("Clean Up"){
steps{
deleteDir()
}
}
stage("Clone Repo"){
steps {
bat "git clone https://github.com/CBoton/spring-boot-hello-world.git"
}
}
stage("Build"){
steps {
dir("spring-boot-hello-world") {
bat "mvn clean install"
}
}
}
stage("Test") {
steps {
dir("spring-boot-hello-world") {
bat "mvn test"
}
}
}
stage("Run") {
steps {
dir("spring-boot-hello-world") {
bat "mvn spring-boot:run"
}
}
}
}
}
Thanks in advance for any suggestions.
Cheers