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

Git fetch when pulling pod template fails when the "Branch Specifier" is an env var

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • git-plugin
    • None

      I have a pipeline job that takes a branch as a parameter and then passes that value to the `Branch Specifier` like so: `${BRANCH}`.

      The git plugin expands the value properly, but I believe that when the kubernetes plugin tries to do another checkout to read the pod template, it doesn't expand the variable and then fails.

       

       

       

      Steps to reproduce:
      1. Configure a pipeline job with a string parameter called `BRANCH`

      2. For the pipeline definition, configure it to use "Pipeline script from SCM"
      3. Use the `Git` SCM and configure it to point to your repo

      4. `Branches to build` -> `Branch Specifier` - should be set to `${BRANCH}` or whatever your parameter is called

      5. Specify your Jenkinsfile path
      – Specify the pod template using `yamlFile`
      6. `Lightweight checkout` should be unchecked

      7. Attempt to build the job

       

      Stripped down version of my jenkinsfile: Jenkinsfile

       

            Unassigned Unassigned
            thnguyen Tommy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: