A jenkins docker container which uses a config from a remote repository to start a jenkins server.
- Copy the docker-compose.yml.dist to docker-compose.yml
- Define the JENKINS_CONFIG_BRANCH and JENKINS_CONFIG_REPOSITORY in the docker-compose.yml
- (Optional) Use the jenkins-config/plugins.txt to set plugins which are needed for the jenkins configuration. They will be downloaded in the process using the jenkins container.
- (Optional) Put a .ssh/ folder beneath jenkins-config/ which will be copied into the jenkins home directory before getting the remote git repository.
- Start the container
docker-compose up
- Visit jenkins http://localhost:8080/
It creates a volume for the /var/jenkins_home folder. The volume remains if you use "docker-compose down".
docker-compose down
docker-compose build
docker-compose up
- Visit $jenkins-url/script
- Paste in and execute
Jenkins.instance.pluginManager.plugins.each{
plugin ->
println ("${plugin.getShortName()}:${plugin.getVersion()}")
}
- Copy and paste output to jenkins-config/plugins.txt
The bash-scripts are written in bash and use best pratices.
- Guide: https://github.com/progrium/bashstyle
- Linter: https://github.com/koalaman/shellcheck
- Beautifier: https://github.com/bemeurer/beautysh
It should pass:
$ shellcheck scripts/*
$ beautysh -f scripts/*