Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CredentialsById.update to create/update credential by id #809

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kkpattern
Copy link

There are two cases where creating/updating credential by id is needed:

  1. The credential id is needed in the pipeline script.
  2. The description of the credential is an empty string or conflict with another credential(often happens when there are lots of existing credentials missing description).

So I added CredentialsById.update to create/update credential by id.

Example:

jenkins = Jenkins(
    jenkins_host,
    username=os.environ["JENKINS_USERNAME"],
    password=os.environ["JENKINS_PASSWORD"],
    timeout=10)
credential = UsernamePasswordCredential({
    "description": "Test credential.",
    "userName": "test_user_name",
    "password": "test_password",
    "credential_id": "TEST_CREDENTIAL"})
jenkins.credentials_by_id.update(credential)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant