Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tomasbjerre/jenkins-configuration-as-code-sandbox
Jenkins Configuration as Code, JCasC, Job DSL, Pipeline, Shared library
https://github.com/tomasbjerre/jenkins-configuration-as-code-sandbox
gitlab jcasc jenkins jenkins-configuration jenkins-job-dsl jenkins-pipeline-library
Last synced: 3 months ago
JSON representation
Jenkins Configuration as Code, JCasC, Job DSL, Pipeline, Shared library
- Host: GitHub
- URL: https://github.com/tomasbjerre/jenkins-configuration-as-code-sandbox
- Owner: tomasbjerre
- License: apache-2.0
- Created: 2018-08-10T11:48:21.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-01-07T14:24:33.000Z (about 3 years ago)
- Last Synced: 2024-11-08T10:48:54.709Z (3 months ago)
- Topics: gitlab, jcasc, jenkins, jenkins-configuration, jenkins-job-dsl, jenkins-pipeline-library
- Language: Groovy
- Homepage: https://bjurr.com/jenkins-configuration-as-code-and-gitlab/
- Size: 79.1 KB
- Stars: 109
- Watchers: 5
- Forks: 57
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Jenkins Configuration as Code Sandbox
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:
* Global Jenkins settings - With [Jenkins Configuration as Code](https://jenkins.io/projects/jcasc/).
* Jenkins job configurations - With [Job DSL](https://github.com/jenkinsci/job-dsl-plugin/wiki).
* Jenkins build process - With [Pipelines](https://jenkins.io/doc/book/pipeline/) and [Shared Library](https://jenkins.io/doc/book/pipeline/shared-libraries/).
* Application source code - With [GitLab](https://docs.gitlab.com/ce/).This allows for you to:
* Do local development of the CI/CD setup. Giving self confidence to do refactorings and keep all the scripts clean.
* Allow code review of changes to the installation. Enable anyone to contribute to an innovative build CI/CD process.
* Manage different installations in different branches. Push to the branch of installation **X** and **X** will automatically be re-configured.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:
* The pipeline code can be developed generically. Pipelines are not created to take care of a specific repo. Generic features are created, and documented, and the application developers chooses what features that should apply to thir repo. By editing `/jenkins-settings.json` in their repo. A default set of settings are derived and applied if no properties found in the repo.
* The solution becomes scalable and can handle a vast amount of application repositories. With low effort needed for support.## Usage
**Start Environment**
```shell
docker-compose up -d
```GitLab will be available in a few moments at http://localhost/ and you can login with credentials found [here](gitlab-setup/config.txt).
Jenkins now available on: http://localhost:8080/
JobDSL docs available at: http://localhost:8080/plugin/job-dsl/api-viewer/index.html
**Destroy Environment**
```shell
docker-compose down -v --rmi local
```
all services are down and data lostEnjoy!