Jenkins Configuration as Code, JCasC, Job DSL, Pipeline, Shared library
This is an example of Jenkins Configuration as Code with GitLab.
This is a fully working CI/CD setup with Jenkins and GitLab where everything is put under version control:
This allows for you to:
It also demonstrates a pattern where a "contract" is established between application repositories and the infrastructure. A jenkins-settings.json
-file is created in the application repositories to tweak the build process. This means:
/jenkins-settings.json
in their repo. A default set of settings are derived and applied if no properties found in the repo.Start Environment
docker-compose up -d
GitLab will be available in a few moments at http://localhost/ and you can login with credentials found here.
Jenkins now available on: http://localhost:8080/
JobDSL docs available at: http://localhost:8080/plugin/job-dsl/api-viewer/index.html
Destroy Environment
docker-compose down -v --rmi local
all services are down and data lost
Enjoy!