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

git-plugin should support tags in multibranch pipeline configurations

    XMLWordPrintable

Details

    • New Feature
    • Status: Closed (View Workflow)
    • Minor
    • Resolution: Fixed
    • git-plugin
    • None

    Description

      Currently the git plugin doesn't seem to support tags in multi-branch builds.  It looks like this is because the ref prefixes are hard-coded. See: https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/jenkins/plugins/git/AbstractGitSCMSource.java#L417

      This is similar to JENKINS-34395 but for the git plugin.  I'm creating a  separate issue because the causes and the fixes appear to be unrelated.

      Attachments

        Issue Links

          Activity

            The env.TAG_NAME will be non-null when building a tag

            stephenconnolly Stephen Connolly added a comment - The env.TAG_NAME will be non-null when building a tag
            markewaite Mark Waite added a comment -

            hamiltb if you need to determine the list of all tags which point at a specific SHA1, you can use the shell command:

            git tag --points-at HEAD

            The env.TAG_NAME which stephenconnolly references should be more reliable than the points-at shell trick, since it is set inside the plugins, rather than being guessed from the condition of the repository.

            markewaite Mark Waite added a comment - hamiltb if you need to determine the list of all tags which point at a specific SHA1, you can use the shell command: git tag --points-at HEAD The env.TAG_NAME which stephenconnolly references should be more reliable than the points-at shell trick, since it is set inside the plugins, rather than being guessed from the condition of the repository.
            hamiltb Bill Hamilton added a comment - - edited

            stephenconnolly markewaite

            env.TAG_NAME doesnt exist in a tag build. I printed out all envars:

            @NonCPS
            def printParams() {
            env.getEnvironment().each { name, value -> println "$name : $value" }
            }
            printParams()

            and TAG_NAME isnt there.

            hamiltb Bill Hamilton added a comment - - edited stephenconnolly markewaite env.TAG_NAME doesnt exist in a tag build. I printed out all envars: @NonCPS def printParams() { env.getEnvironment().each { name, value -> println "$name : $value" } } printParams() and TAG_NAME isnt there.

            What version of Branch API? TAG_NAME was added in 2.0.11

            stephenconnolly Stephen Connolly added a comment - What version of Branch API? TAG_NAME was added in 2.0.11
            hamiltb Bill Hamilton added a comment -

            Yep, works good now, thanks!

            hamiltb Bill Hamilton added a comment - Yep, works good now, thanks!

            People

              stephenconnolly Stephen Connolly
              kbrowder Kevin Browder
              Votes:
              3 Vote for this issue
              Watchers:
              11 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: