Skip to content

Instantly share code, notes, and snippets.

@akerouanton
Last active June 1, 2016 00:31
Show Gist options
  • Save akerouanton/8624cf225ea7aa71e3e86e2dbee9163a to your computer and use it in GitHub Desktop.
Save akerouanton/8624cf225ea7aa71e3e86e2dbee9163a to your computer and use it in GitHub Desktop.
import jenkins.model.*
import hudson.security.*
def instance = Jenkins.getInstance()
println "--> creating local user 'admin'"
def HudsonPrivateSecurityRealm hudsonRealm = new HudsonPrivateSecurityRealm(false)
hudsonRealm.createAccount('admin','admin')
instance.setSecurityRealm(hudsonRealm)
def FullControlOnceLoggedInAuthorizationStrategy strategy = new FullControlOnceLoggedInAuthorizationStrategy()
instance.setAuthorizationStrategy(strategy)
instance.save()
FROM jenkins:2.3
COPY plugins.txt /usr/share/jenkins/ref/
RUN /usr/local/bin/plugins.sh /usr/share/jenkins/ref/plugins.txt
COPY basic-security.groovy /usr/share/jenkins/ref/init.groovy.d/basic-security.groovy
version: '2'
services:
jenkins:
build: .
ports:
- 80:8080
volumes:
- "jenkins:/var/jenkins_home"
volumes:
jenkins:
driver: local
promoted-builds:latest
git-client:latest
managed-scripts:latest
handlebars:latest
maven-plugin:latest
pipeline-stage-view:latest
javadoc:latest
ssh-slaves:latest
workflow-aggregator:latest
ssh-agent:latest
vsphere-cloud:latest
pipeline-input-step:latest
mapdb-api:latest
git:latest
workflow-step-api:latest
ace-editor:latest
workflow-api:latest
rebuild:latest
scm-api:latest
workflow-job:latest
plain-credentials:latest
ghprb:latest
workflow-multibranch:latest
workflow-basic-steps:latest
momentjs:latest
workflow-durable-task-step:latest
junit:latest
branch-api:latest
pipeline-stage-step:latest
mailer:latest
project-inheritance:latest
conditional-buildstep:latest
durable-task:latest
token-macro:latest
build-timeout:latest
jquery-detached:latest
pipeline-build-step:latest
credentials:latest
ssh-credentials:latest
structs:latest
matrix-project:latest
github:latest
parameterized-trigger:latest
build-flow-plugin:latest
cloudbees-folder:latest
github-api:latest
node-iterator-api:latest
git-server:latest
workflow-support:latest
job-dsl:latest
run-condition:latest
script-security:latest
workflow-cps:latest
config-file-provider:latest
workflow-cps-global-lib:latest
workflow-scm-step:latest
pipeline-rest-api:latest
swarm:latest
docker-plugin:latest
cluster-stats:latest
docker-workflow:latest
docker-commons:latest
authentication-tokens:latest
icon-shim:latest
credentials:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment