Set a system environment variable AUTHZ_JSON_URL
that points to a JSON file with the following structure:
{
"admins": [
"groupA",
"userA"
],
This is a snippet that will create a new user in jenkins and if security has been disabled , it will enable it :)
import jenkins.model.*
import hudson.security.*
def instance = Jenkins.getInstance()
def hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount("MyUSERNAME","MyPASSWORD")
instance.setSecurityRealm(hudsonRealm)
#!/bin/bash | |
gource \ | |
-s .03 \ | |
-1280x720 \ | |
--auto-skip-seconds .1 \ | |
--multi-sampling \ | |
--stop-at-end \ | |
--key \ | |
--highlight-users \ |
def jobs = ["JobA", "JobB", "JobC"] | |
def parallelStagesMap = jobs.collectEntries { | |
["${it}" : generateStage(it)] | |
} | |
def generateStage(job) { | |
return { | |
stage("stage: ${job}") { | |
echo "This is ${job}." |
# Credit http://stackoverflow.com/a/2514279 | |
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r |