Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-27875

Add ability to skip the default build step triggered by downstream build step such as Jenkins release-plugin

XMLWordPrintable

      Hi

      we would like to use Jenkins release-plugin[1] to run maven release for Jenkins Maven freestyle job. This plugin works by configuring the Jenkins release-plugin pre-build step with a top level maven build with –B release:prepare release:perform. This big drawback is after the successful pre-build step, it also runs the default build step(usually with clean deploy). This means the build time is double.

      To solve the issue[2][3], we need a way to get downstream build step(ie Jenkins release plugin) to notify Jenkins-core to skip the default build steps

      Here are the proposes implementations
      1. Introduce a ‘release build step’, once it is executed and return back to Jenkins core[4] with an instance of Environment [5]
      2. Set the return Environment instance to null, or introduce a new flag in the Environment class .
      3. Jenkins core’s Build.java ( and related concrete class ) skip the default build step base on the status of the return Environment instance or the status of the new flag

      A pull request will follow

      By doing the change in Jenkins core the same problem in “M2Release plugin” can also be addressed. Thus providing a leverage to release plugin.

      Thanks
      1)https://wiki.jenkins-ci.org/display/JENKINS/Release+Plugin
      2)https://issues.jenkins-ci.org/browse/JENKINS-11120
      3)https://issues.jenkins-ci.org/browse/JENKINS-27723
      4)https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Build.java
      5)https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Environment.java

            petehayes Peter Hayes
            hshah Harsh Shah
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: