Reputation: 101
I'm looking for a solution for Jenkins running in blue ocean.
What am wanting is, give the following pipeline
A --> B --> C --> D
when the pipeline reaches C the process stops and prompts the screen for a user to authenticate, ideally username/password
Our pipeline requires governance around transitioning between dev, test & live. thus different users need to authenticate before Jenkins goes ahead and deploys.
Does anyone know of a pipeline plugin to achieve this?
Upvotes: 0
Views: 1421
Reputation: 7053
You could just rely on the normal input step, but restrict it to specific users or groups (thereby forcing them to be signed in to click the button).
This can integrate with AD groups or other security plugins in Jenkins.
A simple example:
input message: 'Release to production?', ok: 'Yes', submitter: 'AllowedADGroupName'
If you are wanting to unlock credentials due to the user's approval then you could combine the above with the credential store, check the result of the input and use the (pre-stored) credentials appropriately:
approved = input message: 'Release to production?', ok: 'Yes', submitter: 'AllowedADGroupName'
if (approved) {
withCredentials([usernamePassword(credentialsId: 'privilegedCreds', usernameVariable: 'USER', passwordVariable: 'PASS')]) {
...credentially stuff...
}
}
Upvotes: 1