Jenkins with Configuration as Code Plugin installed
587
JCasC - Jenkins Configuration as Code Plugin is a way to manage Jenkins configuration as versioned files managed in SCM, which can be tested, discussed and validated in various environment before they actually update the production target.
If also means it is easy to restore previous configuration or quickly spin-up new Jenkins instance if there is a need.
praqma/docker4jcasc is an image based on Jenkins with JCasC Plugin preinstalled
praqma/docker4jcasc requires two environment variables to be set and passed when running the container. Variables are used to specify the location on jenkins.yaml and plugins.yml file. More details about how to use the file to configure Jenkins available at plugin page
As an example files from plugin repository can be used:
export JENKINS_CONF=https://raw.githubusercontent.com/Praqma/configuration-as-code-plugin/4157ec101c51c2e0277531e2f9f3eebe7f4e5904/jenkins.yaml
export JENKINS_PLUGINS=https://raw.githubusercontent.com/Praqma/configuration-as-code-plugin/master/plugins.yml
Use docker-compose up -d --no-build to run the container with following docker-compose.yml:
version: "2"
services:
jmaster:
image: praqma/docker4jcasc:latest
build:
context: .
args:
- JAVA_OPTS
restart: unless-stopped
logging:
driver: "json-file"
options:
max-size: "200m"
max-file: "3"
ports:
- "8080:8080"
- "50000:50000"
volumes:
- ./jenkins_home:/var/jenkins_home
- /etc/localtime:/etc/localtime
environment:
- JENKINS_CONF=${JENKINS_CONF}
- JENKINS_PLUGINS=${JENKINS_PLUGINS}
docker pull praqma/docker4jcasc:latest