[JIRA] (JENKINS-60250) "Pipeline script from SCM": Git branch field cannot expand property from file

5 views
Skip to first unread message

ms@docware.de (JIRA)

unread,
Nov 22, 2019, 2:24:02 PM11/22/19
to jenkinsc...@googlegroups.com
Michael S. created an issue
 
Jenkins / Bug JENKINS-60250
"Pipeline script from SCM": Git branch field cannot expand property from file
Issue Type: Bug Bug
Assignee: Unassigned
Attachments: image-2019-11-22-20-19-35-959.png
Components: pipeline
Created: 2019-11-22 19:23
Environment:  Pipeline: Job 2.32 (even after upgrade to 2.36) on Jenkins 2.179, Windows 10
Labels: pipeline
Priority: Major Major
Reporter: Michael S.

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.

 

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v7.13.6#713006-sha1:cc4451f)
Atlassian logo

8kirk8@gmail.com (JIRA)

unread,
Mar 10, 2020, 8:48:02 AM3/10/20
to jenkinsc...@googlegroups.com
Max Golionko commented on Bug JENKINS-60250
 
Re: "Pipeline script from SCM": Git branch field cannot expand property from file

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 "downloader.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

"""
    }
  }    
This message was sent by Atlassian Jira (v7.13.12#713012-sha1:6e07c38)
Atlassian logo

8kirk8@gmail.com (JIRA)

unread,
Mar 10, 2020, 8:49:04 AM3/10/20
to jenkinsc...@googlegroups.com
Max Golionko edited a comment on Bug JENKINS-60250
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
{code:java}
  agent {
    kubernetes {
      yamlFile "
downloader pod .yaml"
    }
  }  
{code}

seems that underhood it calls readTrusted
we tried to use
{code:java}

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

but this also didn't work
only inline pod yaml helped to solve this issue
{code:java}

agent {
    kubernetes {
      yaml """
apiVersion: v1
kind: Pod
spec:
  containers:
  - name: jnlp
    image: imagename
    imagePullPolicy: Always

"""
    }
  }    
{code}
Reply all
Reply to author
Forward
0 new messages