I try to load a Jenkinsfile from SCM. If I add the Branch name as full text, everything works well. But if I try to use a parameter or variable (environment) Jenkins do not evaluate this variable, it handle the variable as full text.
Like if I set Branch to ${Branch}
I will get a console output like:
hudson.plugins.git.GitException: Command "git fetch --tags --force --progress --prune -- origin +refs/heads/${Branch}:refs/remotes/origin/${Branch}" returned status code 128:
I tried it also with capital letters, I tried with and wihtout brackets but finaly everything is handled as full text. But the Jenkins help definitly sugget to use:
* **`${ENV_VARIABLE}`**
It is also possible to use environment variables. In this case the variables are evaluated and the result is used as described above.
E.g. `${TREEISH}`, `refs/tags/${TAGNAME}`, ...
I am confused about how to pass a Branchname to the scm to checkout the right Jenkinsfile?