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

Git push tag in case if build SUCCESS only, UNSTABLE result is not pushing a tag.

    Details

    • Similar Issues:

      Description

      Git push tag only in case if build SUCCESS only, UNSTABLE result is not push a tag.

      Since UNSTABLE status in general can be "stable" with warnings. Since compilation errors or something critical don't happens during build we need to have ability to push tag even build is unstable.

      Possible fix I will push as pull request.

        Attachments

          Activity

          Hide
          ajk8 Adam Kaufman added a comment -

          I would like to be able to push tags on SUCCESS or UNSTABLE, but not on FAILURE. Currently this is not possible. I see that the pull request was denied...any chance of getting functionality like this into the plugin?

          Show
          ajk8 Adam Kaufman added a comment - I would like to be able to push tags on SUCCESS or UNSTABLE, but not on FAILURE. Currently this is not possible. I see that the pull request was denied...any chance of getting functionality like this into the plugin?
          Hide
          markewaite Mark Waite added a comment -

          Adam Kaufman that functionality won't be added into the plugin unless someone reworks the submission based on the feedback that was provided on the submission. Since the pull request was closed about 2 years ago, it is unlikely that will arrive in the plugin.

          Show
          markewaite Mark Waite added a comment - Adam Kaufman that functionality won't be added into the plugin unless someone reworks the submission based on the feedback that was provided on the submission. Since the pull request was closed about 2 years ago, it is unlikely that will arrive in the plugin.
          Hide
          jbochenski Jakub Bochenski added a comment -

          Once again Jenkins kicks you in the teeth for using the fancy features. Just go with a shell script

          git push origin $GIT_LOCAL_BRANCH 


          in last build step wrapped with a conditional. https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin
          You need the credentials available via CLI for that – we use Docker, so we just put ssh keys in Dockerfile but you could also use one of the plugins for managing secrets.

          Above works, unless you have other publishers that can change the status (like me).
          You could try https://wiki.jenkins-ci.org/display/JENKINS/PostBuildScript+Plugin but it's unmaintaned and I haven't yet checked if it isn't afflicted by a similar bug as this.
          The https://wiki.jenkins-ci.org/display/JENKINS/Post+build+task only let's you grep console, which is too ugly for my taste.

          Last resort is a groovy/shell script checking the build status manually and calling git push based on that.

          Show
          jbochenski Jakub Bochenski added a comment - Once again Jenkins kicks you in the teeth for using the fancy features. Just go with a shell script git push origin $GIT_LOCAL_BRANCH in last build step wrapped with a conditional. https://wiki.jenkins-ci.org/display/JENKINS/Conditional+BuildStep+Plugin You need the credentials available via CLI for that – we use Docker, so we just put ssh keys in Dockerfile but you could also use one of the plugins for managing secrets. Above works, unless you have other publishers that can change the status (like me). You could try https://wiki.jenkins-ci.org/display/JENKINS/PostBuildScript+Plugin but it's unmaintaned and I haven't yet checked if it isn't afflicted by a similar bug as this. The https://wiki.jenkins-ci.org/display/JENKINS/Post+build+task only let's you grep console, which is too ugly for my taste. Last resort is a groovy/shell script checking the build status manually and calling git push based on that.
          Hide
          jbochenski Jakub Bochenski added a comment -

          Mark Waite would it be possible to at least update the documentation which is clearly wrong? Currently the publisher will only push on "Stable" status not "Successful".
          I know about JENKINS-10763 , but what the permalinks show (lastSuccessfullBuild vs lastStableBuild) is quite prominent so I'd go with that.

          Show
          jbochenski Jakub Bochenski added a comment - Mark Waite would it be possible to at least update the documentation which is clearly wrong? Currently the publisher will only push on "Stable" status not "Successful". I know about JENKINS-10763 , but what the permalinks show ( lastSuccessfullBuild vs lastStableBuild ) is quite prominent so I'd go with that.
          Hide
          markewaite Mark Waite added a comment -

          Jakub Bochenski, the wiki page for documentation is available for anyone to edit and improve. Please feel free to improve it.

          The online help is available in the source code repository for anyone to clone and submit pull requests. Please feel free to submit a pull request to improve it.

          Show
          markewaite Mark Waite added a comment - Jakub Bochenski , the wiki page for documentation is available for anyone to edit and improve. Please feel free to improve it. The online help is available in the source code repository for anyone to clone and submit pull requests. Please feel free to submit a pull request to improve it.

            People

            • Assignee:
              Unassigned
              Reporter:
              vkravets Vladimir Kravets
            • Votes:
              4 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated: