I've been struggling with the same problem all week.

What I've determined is that the git plugin is either ignoring any variables created in Parameterized Build, or they are not getting passed. However, Parameterized Build can override variables the Git Plugin cares about.

Environment:

  • Use separate directories for workspace set to $GIT_BRANCH/src
  • Delete workspace & Force Clone

Test Case 1: Override GIT_BRANCH
If you create a GIT_BRANCH parameter and run a build with garbage text, you can see the github plugin use that text (by the way, overriding GIT_BRANCH is bad, because it will override all of your automatic github push triggers too). This test shows that Parameterized Build at least runs before the git plugin uses its GIT_BRANCH variable.

Test Case 2: Create a new variable "MYBRANCH", specify $MYBRANCH as the branch to build.
If you now run a paramarized build and set this with some garbage (eg. not a real branch), the git clone should fail. But $MYBRANCH is treated as whitespace because it doesn't exist to the git plugin, thus performing default build behavior and building the last branch to get an update.

Test Case 3: Wrap MYBRANCH with curly braces ${MYBRANCH}
No difference

Test Case 4: Put garbage directly into the branch to build path
Type "asdasd" into the branch to build and see the build fail.

I also then added the EnvInject plugin and attempted to set the GIT_BRANCH variable from there, based on another variable's value, to no success.

My conclusion is that the Git plugin is not evaluating any environment variables passed into the branch specifications. This basically means parameterized builds are useless.

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