Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up[FIXED JENKINS-42858] Process credentials before rest of environment #141
Conversation
I don't think there's a reasonable use case for an environment variable being in the credentials ID, so there's really no reason *not* to do credentials first, is there? This allows credentials to be referenced by other environment variables.
reviewbybees
commented
Mar 17, 2017
|
This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation. |
|
Since we switched to expanding the environment to after the agent has been allocated there is no reason any more. It used to be needed because the |
| withCredentialsBlock(thisStage.getEnvCredentials()) { | ||
| withEnvBlock(thisStage.getEnvVars(root, script)) { | ||
| if (evaluateWhen(thisStage.when)) { | ||
| inDeclarativeAgent(thisStage, root, thisStage.agent) { |
This comment has been minimized.
This comment has been minimized.
rsandell
Mar 21, 2017
Member
withCredentials step requires a workspace so this will only work when there is a global agent allocated.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
abayer
Mar 21, 2017
Author
Member
Yup, I see it now. I've opened https://issues.jenkins-ci.org/browse/JENKINS-42999 (with a PR at jenkinsci/credentials-binding-plugin#34) to get withCredentials to stop requiring a workspace unless one or more of the MultiBindings passed to it requires a workspace itself.
This comment has been minimized.
This comment has been minimized.
No, I can honestly say this not a safe assumption. People will have different credentials depending on possibly branch or other env var - This would a place where env var magical ordering is not as good as simple sequential evaluation. |
|
@bitwiseman Ugggggh. Well, that's a pain. |
|
Closed in favor the omnibus at #147 |
abayer commentedMar 17, 2017
•
edited
withCredentialscurrently requiring a workspace.