my code:
podTemplate(label: slave_label, cloud: ${cloud_name}, readFile : 'deploy.yml') {
}
I used yamlFile and readFile also its not taking the inputs. bddrunner pod is not starting
When I use this direct yaml method its working fine. like this:
podTemplate(label: slave_label, cloud: ${cloud_name}, yaml: """ """) {
}
How can I fix this?
The option is yamlFile
not readFile
See this example https://github.com/jenkinsci/kubernetes-plugin/blob/master/examples/declarative_from_yaml_file/Jenkinsfile
yamlFile: readFile('path-to-file')
It must be noted that readFile only works inside an active workspace. That means you have to be in a Node section. https://jenkins.io/doc/pipeline/steps/workflow-basic-steps/#readfile-read-file-from-workspace
Your code should be:
podTemplate(label: slave_label, cloud: ${cloud_name}, yaml: readFile('deploy.yml')) {
}