-
Improvement
-
Resolution: Duplicate
-
Minor
-
Jenkins ver. 2.164.3
kubernetes plugin: 1.15.5
pipeline plugin: 2.6
Pipeline declarative plugin: 1.3.8
Reproduce step:
1. Create a parameterized pipeline job.
2. Add the string parameter called `branch`
2. Configure the pipeline definition to `Get Pipeline script from SCM`.
3. Update the section of `Branches to build` to `*/${branch}` as the parameter added above.
4. Add the following code to the file `Jenkinsfile`.
pipeline { agent { kubernetes { label 'jks-builds' yamlFile 'path/to/podTemplate.yaml' } } stages { stage('test') { steps { echo "test" } } } }
with the above reproducing steps you will get the following failed messages:
hudson.plugins.git.GitException: Command "git fetch --tags --progress origin +refs/heads/${branch}:refs/remotes/origin/${branch} --prune" returned status code 128:
stdout:
stderr: fatal: Couldn't find remote ref refs/heads/${branch}
however, it works if you remove the directive of `yamlFile` or using the raw yaml string instead.
- duplicates
-
JENKINS-56943 Loading yamlFile not working with parameterized git branch
- Resolved
- is related to
-
JENKINS-53472 Expand environment variables in yaml
- Open