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

"Pipeline script from SCM": Git branch field cannot expand property from file

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Component/s: pipeline
    • Labels:
    • Environment:
       Pipeline: Job 2.32 (even after upgrade to 2.36) on Jenkins 2.179, Windows 10
    • Similar Issues:

      Description

      We converted out freestyle jobs to pipeline jobs using "Pipeline script from SCM". The Git branch field for the Jenkinsfile to load cannot expand a property which comes from a property file, which name is entered in "Properties File Path". I can however expand a property entered in "Property Content". The properties file is correct because we successfully used to populate the Git branch field for our previous freestyle jobs.

      "Lightweight checkout" checkbox is unchecked.

      A related (solved) issue is JENKINS-42971.

       

        Attachments

          Issue Links

            Activity

            Hide
            kirk_gm Max Golionko added a comment - - edited

            We have same problem, but in our case we don't have readTrusted
            But we are using kubernetes with kubernetes-plugin, and we were using yaml file for pod configuration

              agent {
                kubernetes {
                  yamlFile "pod.yaml"
                }
              }  
            

            seems that underhood it calls readTrusted
            we tried to use

              agent {
                kubernetes {
                  yaml readFile("./pod.yaml")
                }
              }
            

            but this also didn't work
            only inline pod yaml helped to solve this issue

            agent {
                kubernetes {
                  yaml """
            apiVersion: v1
            kind: Pod
            spec:
              containers:
              - name: jnlp
                image: imagename
                imagePullPolicy: Always
            
            """
                }
              }    
            
            Show
            kirk_gm Max Golionko added a comment - - edited We have same problem, but in our case we don't have readTrusted But we are using kubernetes with kubernetes-plugin, and we were using yaml file for pod configuration agent { kubernetes { yamlFile "pod.yaml" } } seems that underhood it calls readTrusted we tried to use agent { kubernetes { yaml readFile( "./pod.yaml" ) } } but this also didn't work only inline pod yaml helped to solve this issue agent { kubernetes { yaml """ apiVersion: v1 kind: Pod spec: containers: - name: jnlp image: imagename imagePullPolicy: Always """ } }

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              docwarems Michael S.
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated: