Details
-
Bug
-
Status: Reopened (View Workflow)
-
Major
-
Resolution: Unresolved
-
None
-
Jenkins LTS 2.32.3 + All plugins up to date.
Pipeline: Build Step : 2.4
Git client plugin : 2.3
Description
Pipeline from SCM does not expand parameters or environment variables
Steps to reproduce:
- Create a new Pipeline with a String Parameter "PIPELINE_BRANCH"
- In the pipeline definition ; Select "Pipeline Script from SCM"
- Enter the repository URL
- In branch to build, enter the parameter : ${PIPELINE_BRANCH}
- Enter your script path
- Run the job with a valid branch
An error in thrown :
hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/${PIPELINE_BRANCH}:refs/remotes/origin/${PIPELINE_BRANCH} --prune" returned status code 128:
stdout:
${PIPELINE_BRANCH} is not replaced by its value.
Same issue with an environment variable.
Expanding parameters/variable is working fine for a freestyle or matrix job.
Attachments
Issue Links
- duplicates
-
JENKINS-28447 CpsScmFlowDefinition does not resolve variables
-
- Resolved
-
- is duplicated by
-
JENKINS-37681 PipelineScript from SCM is not accepting Parameters as input
-
- Resolved
-
-
JENKINS-36411 Cannot access environment variable from parameterized plugin in pipeline checkout
-
- Resolved
-
- is related to
-
JENKINS-48431 Pipeline script from SCM should support build parameters using Lightweight checkout
-
- Open
-
-
JENKINS-49758 when passing in ref_spec with build parameters, the exact string "$REF_SPEC" is used rather then the value
-
- Open
-
-
JENKINS-60250 "Pipeline script from SCM": Git branch field cannot expand property from file
-
- Open
-
- relates to
-
JENKINS-42836 Build parameter not expanded in script path
-
- Resolved
-
We have still a problem with Pipeline: Job 2.32 (even after upgrade to 2.36) on Jenkins 2.179. "Lightweight checkout" checkbox unchecked. Parameter Expansion does not work if parameter comes from "Properties File Path", It works, however, with parameter from "Properties Content". Too bad.
BTW, our properties file is correct because it previously worked with a freestyle job.
I created new issue JENKINS-60250.