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

Overriding build goal while performing a release

      The current release plugin performs a build twice when a release is done. It does one build using the default build goal and then it builds again using the release goal. I am trying to override the default build goal and just perform the release goal at time of release. To do so we need to have the release goal input from the user so have added one more field in the configuration environment. Kindly see the attached image.

      Thought this option is available in pre release menu but still it does not override the default build and performs two builds at time of release which take more time.

          [JENKINS-27723] Overriding build goal while performing a release

          Harsh Shah created issue -
          Harsh Shah made changes -
          Description Original: The current release plugin performs a build twice when a release is done. It does one build using the default build goal and then it builds again using the release goal. I am trying to override the default build goal and just perform the release goal at time of release. To do so we need to have the release goal input from the user so have added one more field in the configuration environment. Kindly see the attached image. New: The current release plugin performs a build twice when a release is done. It does one build using the default build goal and then it builds again using the release goal. I am trying to override the default build goal and just perform the release goal at time of release. To do so we need to have the release goal input from the user so have added one more field in the configuration environment. Kindly see the attached image.

          Thought this option is available in pre release menu but still it does not override the default build and performs two builds at time of release which take more time.

          dan tran added a comment -

          I need this as well. The current plugin we need to insert -B release:prepare release:perform to a pre-release step, the release ended up to build twice ( run the release and run the normal job) which make to build twice longer, and it is also very hacky. Harsh's proposal fits my need, and make maven release very nature to this plugin.

          dan tran added a comment - I need this as well. The current plugin we need to insert -B release:prepare release:perform to a pre-release step, the release ended up to build twice ( run the release and run the normal job) which make to build twice longer, and it is also very hacky. Harsh's proposal fits my need, and make maven release very nature to this plugin.
          dan tran made changes -
          Link New: This issue is related to JENKINS-11120 [ JENKINS-11120 ]
          Harsh Shah made changes -
          Assignee Original: Peter Hayes [ petehayes ] New: Harsh Shah [ hshah ]
          Harsh Shah made changes -
          Status Original: Open [ 1 ] New: In Progress [ 3 ]
          Harsh Shah made changes -
          Assignee Original: Harsh Shah [ hshah ] New: Peter Hayes [ petehayes ]
          dan tran made changes -
          Priority Original: Minor [ 4 ] New: Critical [ 2 ]

          Harsh Shah added a comment -

          We found a way to have the jenkins release-plugin to notify Jenkins core to skip the default build

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

          This means we need help from Jenkins core dev to add new capability in Jenkins core to skip the default build step. Will file an RFE with Jenkins core

          Thanks

          [1] https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Build.java

          [2] https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Environment.java

          Harsh Shah added a comment - We found a way to have the jenkins release-plugin to notify Jenkins core to skip the default build 1. Introduce a ‘release build step’, once it is executed and return back to Jenkins core [1] with an instance of Environment [2] 2. Set the return Environment instance to null, or introduce an new flag in the environment class which notifies to override the default build. 3. Jenkins core’s Build.java ( and related concrete class ) skip the default build step base on the status of the return Env instance or the status of the new flag This means we need help from Jenkins core dev to add new capability in Jenkins core to skip the default build step. Will file an RFE with Jenkins core Thanks [1] https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Build.java [2] https://github.com/jenkinsci/jenkins/blob/master/core/src/main/java/hudson/model/Environment.java
          Harsh Shah made changes -
          Link New: This issue depends on JENKINS-27875 [ JENKINS-27875 ]

            Unassigned Unassigned
            hshah Harsh Shah
            Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: