GithubHelp home page GithubHelp logo

sanhajio / jenkins-configuration-as-code-sandbox Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tomasbjerre/jenkins-configuration-as-code-sandbox

0.0 2.0 0.0 72 KB

Jenkins Configuration as Code, JCasC, Job DSL, Pipeline, Shared library

Home Page: https://bjurr.com/jenkins-configuration-as-code-and-gitlab/

License: Apache License 2.0

Dockerfile 1.87% Shell 18.27% Groovy 78.60% Ruby 0.20% Java 1.06%

jenkins-configuration-as-code-sandbox's Introduction

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:

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

1. Start GitLab

Start GitLab and keep it running in one terminal:

./build-and-run-gitlab.sh

GitLab now available at http://localhost/ and you can login with credentials found here.

2. Setup GitLab

This script will import some projects into Gitlab and create a personal access token to use in Jenkins.

./setup-gitlab.sh

3. Start Jenkins

./build-and-run-jenkins.sh

Jenkins now available on: http://localhost:8080/

JobDSL docs available at: http://localhost:8080/plugin/job-dsl/api-viewer/index.html

jenkins-configuration-as-code-sandbox's People

Contributors

tomasbjerre avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.