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

Jenkins 2.x - Pipeline - variables from paramaetrized build not evaluated for Git

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Duplicate
    • Component/s: git-plugin
    • Labels:
      None
    • Environment:
      Jenkins 2.x (also RC1)
    • Similar Issues:

      Description

      • Just installed latest Jenkins 2.0 and creating simple Pipeline job.
      • Adjust the job as parametrized build
      • Define a string parameter "TAG" (default to "master")
      • choose "Pipeline sscript from SCM" for the pipeline definition
      • choose "Git" as SCM
      • Select any valid Git URL (example: https://github.com/jenkinsci/job-dsl-plugin)
      • Put ${TAG} to "Branches to build"

      The job fails as following:

      Started by user Thomas Lehmann
       > git rev-parse --is-inside-work-tree # timeout=10
      Fetching changes from the remote Git repository
       > git config remote.origin.url https://github.com/jenkinsci/job-dsl-plugin # timeout=10
      Fetching upstream changes from https://github.com/jenkinsci/job-dsl-plugin
       > git --version # timeout=10
       > git -c core.askpass=true fetch --tags --progress https://github.com/jenkinsci/job-dsl-plugin +refs/heads/*:refs/remotes/origin/*
       > git rev-parse origin/${TAG}^{commit} # timeout=10
       > git rev-parse ${TAG}^{commit} # timeout=10
      ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
      Finished: FAILURE
      

      The variable TAG is not evaluated.

        Attachments

          Issue Links

            Activity

            thomas_lehmann Thomas Lehmann created issue -
            thomas_lehmann Thomas Lehmann made changes -
            Field Original Value New Value
            Description * Just installed latest Jenkins 2.0 and creating simple Pipeline job.
            * Adjust the job as parametrized build
            * Define a string parameter "TAG" (default to "master")
            * choose "Pipeline sscript from SCM" for the pipeline definition
            * choose "Git" as SCM
            * Select any valid Git URL (example: https://github.com/jenkinsci/job-dsl-plugin)
            * Put ${TAG} to "Branches to build"

            The job fails as following:

            {code}
            Started by user Thomas Lehmann
            Cloning the remote Git repository
            Cloning repository https://github.com/jenkinsci/job-dsl-plugin
             > git init /var/jenkins_home/workspace/Foo@script # timeout=10
            Fetching upstream changes from https://github.com/jenkinsci/job-dsl-plugin
             > git --version # timeout=10
             > git -c core.askpass=true fetch --tags --progress https://github.com/jenkinsci/job-dsl-plugin +refs/heads/*:refs/remotes/origin/*
             > git config remote.origin.url https://github.com/jenkinsci/job-dsl-plugin # timeout=10
             > git config --add remote.origin.fetch +refs/heads/*:refs/remotes/origin/* # timeout=10
             > git config remote.origin.url https://github.com/jenkinsci/job-dsl-plugin # timeout=10
            Fetching upstream changes from https://github.com/jenkinsci/job-dsl-plugin
             > git -c core.askpass=true fetch --tags --progress https://github.com/jenkinsci/job-dsl-plugin +refs/heads/*:refs/remotes/origin/*
             > git rev-parse origin/${GIT}^{commit} # timeout=10
             > git rev-parse ${GIT}^{commit} # timeout=10
            ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
            Finished: FAILURE
            {code}
            * Just installed latest Jenkins 2.0 and creating simple Pipeline job.
            * Adjust the job as parametrized build
            * Define a string parameter "TAG" (default to "master")
            * choose "Pipeline sscript from SCM" for the pipeline definition
            * choose "Git" as SCM
            * Select any valid Git URL (example: https://github.com/jenkinsci/job-dsl-plugin)
            * Put ${TAG} to "Branches to build"

            The job fails as following:

            {code}
            Started by user Thomas Lehmann
             > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
             > git config remote.origin.url https://github.com/jenkinsci/job-dsl-plugin # timeout=10
            Fetching upstream changes from https://github.com/jenkinsci/job-dsl-plugin
             > git --version # timeout=10
             > git -c core.askpass=true fetch --tags --progress https://github.com/jenkinsci/job-dsl-plugin +refs/heads/*:refs/remotes/origin/*
             > git rev-parse origin/${TAG}^{commit} # timeout=10
             > git rev-parse ${TAG}^{commit} # timeout=10
            ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
            Finished: FAILURE
            {code}

            The variable TAG is not evaluated
            thomas_lehmann Thomas Lehmann made changes -
            Description * Just installed latest Jenkins 2.0 and creating simple Pipeline job.
            * Adjust the job as parametrized build
            * Define a string parameter "TAG" (default to "master")
            * choose "Pipeline sscript from SCM" for the pipeline definition
            * choose "Git" as SCM
            * Select any valid Git URL (example: https://github.com/jenkinsci/job-dsl-plugin)
            * Put ${TAG} to "Branches to build"

            The job fails as following:

            {code}
            Started by user Thomas Lehmann
             > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
             > git config remote.origin.url https://github.com/jenkinsci/job-dsl-plugin # timeout=10
            Fetching upstream changes from https://github.com/jenkinsci/job-dsl-plugin
             > git --version # timeout=10
             > git -c core.askpass=true fetch --tags --progress https://github.com/jenkinsci/job-dsl-plugin +refs/heads/*:refs/remotes/origin/*
             > git rev-parse origin/${TAG}^{commit} # timeout=10
             > git rev-parse ${TAG}^{commit} # timeout=10
            ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
            Finished: FAILURE
            {code}

            The variable TAG is not evaluated
            * Just installed latest Jenkins 2.0 and creating simple Pipeline job.
            * Adjust the job as parametrized build
            * Define a string parameter "TAG" (default to "master")
            * choose "Pipeline sscript from SCM" for the pipeline definition
            * choose "Git" as SCM
            * Select any valid Git URL (example: https://github.com/jenkinsci/job-dsl-plugin)
            * Put ${TAG} to "Branches to build"

            The job fails as following:

            {code}
            Started by user Thomas Lehmann
             > git rev-parse --is-inside-work-tree # timeout=10
            Fetching changes from the remote Git repository
             > git config remote.origin.url https://github.com/jenkinsci/job-dsl-plugin # timeout=10
            Fetching upstream changes from https://github.com/jenkinsci/job-dsl-plugin
             > git --version # timeout=10
             > git -c core.askpass=true fetch --tags --progress https://github.com/jenkinsci/job-dsl-plugin +refs/heads/*:refs/remotes/origin/*
             > git rev-parse origin/${TAG}^{commit} # timeout=10
             > git rev-parse ${TAG}^{commit} # timeout=10
            ERROR: Couldn't find any revision to build. Verify the repository and branch configuration for this job.
            Finished: FAILURE
            {code}

            The variable TAG is not evaluated.
            orrc Christopher Orr made changes -
            Labels wo
            orrc Christopher Orr made changes -
            Labels wo pipeline
            jglick Jesse Glick made changes -
            Link This issue duplicates JENKINS-28447 [ JENKINS-28447 ]
            jglick Jesse Glick made changes -
            Resolution Duplicate [ 3 ]
            Status Open [ 1 ] Resolved [ 5 ]
            jglick Jesse Glick made changes -
            Labels pipeline
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 170160 ] JNJira + In-Review [ 198797 ]
            markewaite Mark Waite made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

              Assignee:
              markewaite Mark Waite
              Reporter:
              thomas_lehmann Thomas Lehmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: