0

i'm fairly new to jenkins and scripted sequential pipelines.

As for now I have two simple stages that are "git checkout" and then "Build".

properties([parameters([choice(choices: ['master'], description: 'Branch to select', name: 'branch')])])

  node{
    
    stage('Git checkout'){
        echo "Pulling changes ${params.branch}"
        
        checkout([$class: 'GitSCM', branches: [[name: '*/master']], extensions: [],          userRemoteConfigs: [[credentialsId: 'some-credentials', url: '<my-git-url>']]])
    }
    
     stage('Build'){
     dir('project/cms') {
        withGradle(){
            echo 'Creating build folder'
            powershell './gradlew clean build'
        }
      }
         
    }
 }

The first stage runs within 5s but the second one takes too long. When I go to check concole output it sais within 50s "Build Successful" but the stage doesn't stop running.

Is there a way to make the stage stop and continue with the pipeline sctipt?

I don't know what can be done to solve this. It just keeps running for more than 10min

Ana
  • 1
  • 2
  • There must have errors at ur 'Build' stage. Please check it again carefully. Beside that, you can set timeout like [this](https://stackoverflow.com/questions/38096004/how-to-add-a-timeout-step-to-jenkins-pipeline). But timeout doesn't return successful result as u wish, obviously. – himneh Nov 08 '22 at 10:02
  • @himneh I ran locally 'gradlew clean build --stacktrace' and it gave me an error due to the use of Jacoco in my build.gradle file. I fixed that error and now there's no errors appearing but my build stage in jenkins keeps running after console gives success. I really dont understand – Ana Nov 08 '22 at 15:44

0 Answers0