-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added creation of default user for build param placeholder.
revert
- Loading branch information
1 parent
cbb5ecd
commit 76ae60f
Showing
3 changed files
with
56 additions
and
27 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
bootstrap/Platform_Management/Create_default_credentials.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import jenkins.model.* | ||
import com.cloudbees.plugins.credentials.* | ||
import com.cloudbees.plugins.credentials.common.* | ||
import com.cloudbees.plugins.credentials.domains.* | ||
import com.cloudbees.plugins.credentials.impl.* | ||
import com.cloudbees.jenkins.plugins.sshcredentials.impl.* | ||
import hudson.plugins.sshslaves.*; | ||
|
||
def add_username_password_credential(id, username, password, description){ | ||
def domain = Domain.global() | ||
def store = Jenkins.instance.getExtensionList('com.cloudbees.plugins.credentials.SystemCredentialsProvider')[0].getStore() | ||
|
||
def defaultUsernameAndPassword = new UsernamePasswordCredentialsImpl( | ||
CredentialsScope.GLOBAL, | ||
id, | ||
description, | ||
username, | ||
password | ||
) | ||
store.addCredentials(domain, defaultUsernameAndPassword) | ||
} | ||
|
||
add_username_password_credential("adop-default","adop-default", "adop-default","Default credentials for Jenkins. This credential does not grant access to any service." ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters