Hi Mark
You were right. I stripped down the config as much as possible.
Create the job:
1. add parameter TargetUrl with repo url of a target.
2. in the scm section add an origin repo with any url directly put in and set credentials. name it origin
3. create a second repo with ${TargetUrl} and name it target
4. put "master" in branch to build
5. add git publisher to "target" repo branch master.

so the only dynamic parameter is the TargetUrl used in scm section for the second repo. I even removed EnvInject plugin, so this doesn't make any difference. You don't need this plugin to reproduce it.
The described build fails. But as soon as I replaced the ${TargetUrl} in the repo url field, it works.

So I assume, the permission error is just because it does not expand the TargetUrl env var (as you already told) and then it will try to push to the origin repo instead of the target. And I don't have the permissions there.
Due the fact it works during the fetch, it seems to be, that just git publisher does not resolve the env var during the push operation.
Not sure whats responsible usually to resolve the env vars, the plugin or if it is usually done just by the shell. But it seems to be that the shell does resolve it to an empty string (that's why git try to push to the origin).

Hope this helps to identify the root cause.

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-issues+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to