Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
/usr/local/bin/docker stop ${CONTAINER_NAME} || echo "no container to stop"
/usr/local/bin/docker rm ${CONTAINER_NAME} || echo "no container to remove"
# the insecure, no plugins install (skips the setup wizard)
/usr/local/bin/docker run \
-e 'JAVA_OPTS="-Djenkins.install.runSetupWizard=false"' \
--detach \
--publish ${PORT_NUMBER}:8080 \
--name ${CONTAINER_NAME} jenkins
# stand around while the app boots up
sleep 10
# list the default plugins
email-ext \
mailer \
ant \
antisamy-markup-formatter \
build-timeout \
cloudbees-folder \
credentials-binding \
git \
github-organization-folder \
gradle \
ldap \
matrix-auth \
pam-auth \
pipeline-stage-view \
ssh-slaves \
subversion \
timestamper \
workflow-aggregator \
ws-cleanup \
for plugin in $DEFAULT_PLUGINS;
curl -s -X POST \
--data "<jenkins><install plugin='${plugin}@latest' /></jenkins>" \
--header 'Content-Type: text/xml' \
# download the hello-world job
curl -s > config.xml
# install the job and restart
/usr/local/bin/docker exec jenkins mkdir var/jenkins_home/jobs/hello-world
/usr/local/bin/docker cp config.xml jenkins:/var/jenkins_home/jobs/hello-world
/usr/local/bin/docker restart jenkins
# stand around while the app boots up
sleep 10
# run the hello-world job
curl -s -X POST http://localhost:${PORT_NUMBER}/job/hello-world/build
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment