Giter Club home page Giter Club logo

jenkins's Introduction

Jenkins Configuration and Jobs as Code

Jenkins Docker Image Actions Status Jenkins LTS Release

Run the fully automated installation of Jenkins from code with infrastructure, configuration, jobs, and plugins.

Introduction

This is the implementation of "Everything as a Code" paradigm. The desired state is to be able to build a Jenkins instance where all of its infrastructure, plugins, credentials, jobs, and many other things are versioned and stored in Git.

System Requirements

This setup was built to support development on a Mac OS environment.

Configuration

Export necessary variables:

export VAULT_APPROLE='role_id'
export VAULT_APPROLE_SECRET='secret_id' 

see this repo for deatail

How To Use

git clone https://github.com/Kostua/Jenkins.git
cd Jenkins/
docker-compose up -d

Screenshots

Jenkins Login Page Jenkins First Page

How its work

There are five files that will be used in this example:

  • Dockerfile - the definition of the Docker image
  • docker-compose.yml - a file that helps us get all the Docker stuff up and running
  • plugins.txt - the plugins that will be pre-installed in Jenkins
  • jenkins.yaml - the definition of Jenkins with predefined job repository

Dockerfile - the definition of the Docker image It defines which version of Jenkins that be used and it pre-installs some plugins and additional packages.

docker-compose.yml - This creates a docker image from the Docker file and run Jenkins with network infra and connect all pice together.

plugins.txt - It contains a list of plugins and versions that should be installed before Jenkins is started.

jenkins.yaml - this is the place where Jenkins Configuration as Code (a.k.a. JCasC) Plugin comes into play. It lets us define the global and plugin configurations through a YAML file. It’s great because it handles the configuration changes and we can deploy an initial Jenkins install with all the configurations already applied.

And this part is full predefined jobs from a repository and run all of them:

jobs:
  - script: >
      freeStyleJob('JobsGenerator') {
        triggers {
                    hudsonStartupTrigger {
                      quietPeriod("60")
                      runOnChoice("ON_CONNECT")
                      label("")
                      nodeParameterName("")
                }
          }
        scm {
            github('Kostua/jenkins_as_code_jobs', 'master')
        }
        steps {
            dsl {
              external('*.groovy')
            }
        }
      }
  - script: >
      queue('JobsGenerator')

Status

Project is: in progress

Contact

Created by @kostua- feel free to contact me!

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.