You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
518 B
20 lines
518 B
#!groovy
|
|
|
|
import jenkins.model.*
|
|
import hudson.security.*
|
|
|
|
def instance = Jenkins.getInstance()
|
|
|
|
println "--> creating local user 'admin'"
|
|
|
|
// Create a default admin user
|
|
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
|
|
hudsonRealm.createAccount('admin', 'A@1qaz2wsxA@')
|
|
instance.setSecurityRealm(hudsonRealm)
|
|
|
|
// Define global security settings
|
|
def strategy = new FullControlOnceLoggedInAuthorizationStrategy()
|
|
strategy.setAllowAnonymousRead(false)
|
|
instance.setAuthorizationStrategy(strategy)
|
|
|
|
instance.save()
|
|
|