This is NOT in a production-usage state, as security realm is opened up for easier local dev
This project configures a base Jenkins with:
- Jenkins master node (jenkins/jenkins:lts plus docker and preinstalled plugins)
- Jenkins slave node (jenkinsci/slave:latest plus docker cli)
- Configuration as Code
- Docker Cloud option for spinning up 'docker' labeled build agents
- Seed Job: Using Job-DSL, creates a "seed/jobs" job that points to the jenkins-local-dsl repo to generate more jobs; This way you can control project jobs from the dsl repo
- Local git server for testing with code repositories
Prerequisites
- Docker
- Build the needful (first time can take a WHILE - builds 2 images)
docker-compose build
- Run the needful
docker-compose up
- Visit http://localhost:8080/ in a browser; To trigger builds/manage Jenkins, user/pass: admin
The docker-compose sets up a jenkins_data volume for persistent Jenkins config. To remove this volume and start over from a clean slate:
- List the volumes matching the filter
docker volume ls | grep jenkins_data
- Remove the volume by name (change accordingly to info from the last command)
docker volume rm jenkins-local_jenkins_data
With the docker-compose stack running, you can clone the repo(s) that are in the local git server
cd /tmp && git clone git://localhost/project-a
cd /tmp && git clone git://localhost/yaml-pipelines-library
On startup (aka, during docker-compose up
), the git-server initiates git repos
from the folders in the git-server/seed-repos. You can
then clone the repo(s), change, commit, and push them as needed while the server
is running. Restart the server and start over from the seed-state.
Currently, the git-server cannot handle start/stop of the container, so you have to make sure to remove the container before starting again; simply run:
docker-compose down
Then you can run the needful again:
docker-compose up