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

Can't use Jenkinsfile for build git tags

    XMLWordPrintable

Details

    • Story
    • Resolution: Duplicate
    • Minor
    • pipeline
    • Jenkins 2.0

    Description

      I try to migrate to Jenkins 2.0 and Jenkinsfile pipeline definition.
      Base idea:

      • on any commit build make all artifacts;
      • on tag build also publish this artifacts to "GitHub releases" and etc.

      Ideally I want something like from Travis world:

      .travis.yml
      install:
      - ./build.package.sh
      deploy:
        - provider: script
          script: ./publish.manual.sh
          on:
            branch: master
        - provider: script
          script: ./publish.release.sh
          on:
            tags: true
      

      My project located on GitHub and I simply created "Multibranch Pipeline" with "GitHub"
      Branch Source. This solved common commit build pipeline. But it can't build git tags.

      I have no idea, how make build for automatic tag build. But manual build trigger is not a problem for me.

      I try to create a "Pipeline" with string parameter "TAG_NAME" and "Pipeline script from SCM" with "Branch Specifier" = "refs/tags/${TAG_NAME}". But this don't work (looks like TAG_NAME is not pass to environment variable).

      Aslo I can't use "TAG_NAME" parameter value on build with default "Branch Specifier" = "*/master".

      Attachments

        Issue Links

          Activity

            People

              jglick Jesse Glick
              bozaro Artem V. Navrotskiy
              Votes:
              3 Vote for this issue
              Watchers:
              12 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: