Jenkins restart a pipeline from a specific stage

Viewed 20

I'm executing a declarative pipeline which generates stages dynamically:

pipeline{
    stages{
        stage("Prepare"){
            script {
              //logic goes here 
              pkg = getAllPkgsOrderToBuild()//inconsistent 
              for(pkg in pkgs){
                  generateBuildStage("$pkg")//uses stage("build $pkg") inside
                  generatePublishStage("$pkg")//uses stage("publish $pkg") inside
                  if(lastIteratation){
                      testing()
                  }
              }
           }
        }
    }
    post{
        always{
            reportBack to: devMail
        }
    }
}

And I want to give to Jenkins' users the ability to restart the pipeline from the failed stage.

Any Idea?

0 Answers
Related