mirror of
https://github.com/nicolabs/script-realm-plugin.git
synced 2025-09-07 05:13:16 +02:00
+ groovy snippet to delete all users from local Jenkins (for tests)
This commit is contained in:
parent
4dfbd174de
commit
9c6b91f336
17
src/test/resources/DeleteAllUsers.groovy
Normal file
17
src/test/resources/DeleteAllUsers.groovy
Normal file
|
@ -0,0 +1,17 @@
|
|||
import hudson.security.*
|
||||
import jenkins.security.*
|
||||
|
||||
//
|
||||
// USE ONLY ON LOCAL JENKINS FOR TESTS !!!
|
||||
// DELETES ALL USERS FROM JENKINS !!!!
|
||||
//
|
||||
|
||||
for ( userInfo in Jenkins.instance.getPeople().users ) {
|
||||
User user = userInfo.getUser()
|
||||
print("Deleting user "+user)
|
||||
user.delete()
|
||||
}
|
||||
|
||||
for ( userInfo in Jenkins.instance.getPeople().users ) {
|
||||
println(userInfo.getUser())
|
||||
}
|
Loading…
Reference in a new issue