All Projects → oleg-nenashev → Demo Jenkins Config As Code

oleg-nenashev / Demo Jenkins Config As Code

Licence: mit
Demo of Jenkins Configuration-As-Code with Docker and Groovy Hook Scripts

Programming Languages

groovy
2714 projects

Projects that are alternatives of or similar to Demo Jenkins Config As Code

Jenkins Library
Shared Library for Jenkine Pipeline
Stars: ✭ 32 (-77.62%)
Mutual labels:  pipeline, jenkins
Localization Zh Cn Plugin
Chinese Localization for Jenkins
Stars: ✭ 65 (-54.55%)
Mutual labels:  hacktoberfest, jenkins
Cimonitor
Displays CI statuses on a dashboard and triggers fun modules representing the status!
Stars: ✭ 34 (-76.22%)
Mutual labels:  hacktoberfest, pipeline
Jenkinsfile Runner
A command line tool to run Jenkinsfile as a function
Stars: ✭ 727 (+408.39%)
Mutual labels:  hacktoberfest, jenkins
Zebrunner
Zebrunner is a Test Automation Management Tool
Stars: ✭ 131 (-8.39%)
Mutual labels:  hacktoberfest, jenkins
Galaxy
Data intensive science for everyone.
Stars: ✭ 812 (+467.83%)
Mutual labels:  hacktoberfest, pipeline
Jenkins Os
Groovy pipeline jobs that build and test Container Linux with Jenkins
Stars: ✭ 43 (-69.93%)
Mutual labels:  pipeline, jenkins
Jenkins
Development repository for the jenkins cookbook
Stars: ✭ 416 (+190.91%)
Mutual labels:  hacktoberfest, jenkins
Jira Steps Plugin
Jenkins pipeline steps for integration with JIRA.
Stars: ✭ 88 (-38.46%)
Mutual labels:  pipeline, jenkins
Custom War Packager
Custom Jenkins WAR packager for Jenkins
Stars: ✭ 77 (-46.15%)
Mutual labels:  hacktoberfest, jenkins
Lambdacd
a library to define a continuous delivery pipeline in code
Stars: ✭ 655 (+358.04%)
Mutual labels:  hacktoberfest, pipeline
Jenkins Pipeline Library
wcm.io Jenkins Pipeline Library for CI/CD
Stars: ✭ 134 (-6.29%)
Mutual labels:  pipeline, jenkins
Docker
Docker official jenkins repo
Stars: ✭ 4,855 (+3295.1%)
Mutual labels:  hacktoberfest, jenkins
Err Jenkins
errbot plugin for Jenkins
Stars: ✭ 18 (-87.41%)
Mutual labels:  hacktoberfest, jenkins
Pipeline
Pipeline is a package to build multi-staged concurrent workflows with a centralized logging output.
Stars: ✭ 433 (+202.8%)
Mutual labels:  pipeline, jenkins
Jenkins Workflow
contains handy groovy workflow-libs scripts
Stars: ✭ 41 (-71.33%)
Mutual labels:  pipeline, jenkins
Kedro
A Python framework for creating reproducible, maintainable and modular data science code.
Stars: ✭ 4,764 (+3231.47%)
Mutual labels:  hacktoberfest, pipeline
Jx
Jenkins X provides automated CI+CD for Kubernetes with Preview Environments on Pull Requests using Cloud Native pipelines from Tekton
Stars: ✭ 4,041 (+2725.87%)
Mutual labels:  pipeline, jenkins
Gitlab Branch Source Plugin
Jenkins-Plugin to create a multi-branch-project from gitlab
Stars: ✭ 76 (-46.85%)
Mutual labels:  pipeline, jenkins
Remoting
Jenkins Remoting module
Stars: ✭ 132 (-7.69%)
Mutual labels:  hacktoberfest, jenkins

Demo image for Jenkins Configuration-as-Code

Docker Build Status

This demo image shows how to establish full configuration-as-code in Jenkins with Docker, Pipeline, and Groovy Hook Scripts. It offer a GroovyBootstrap logic which adds support of Groovy classes, debugging and correct error propagation from scripts.

This demo also brings up environment which can be used to develop Jenkins Pipeline libraries locally and to evaluate Jenkins features like Ownership-Based Security.

❗️ Warning! This image is not designed for production use. Use it at your own risk. Prototyping is in progress, compatibility of the scripts and Dockerfiles is NOT GUARANTEED.

Features

Jenkins container starts with the following contents:

  • Authentication: Internal database with four users. Passwords are same as user names
    • admin - Admin with full access
    • manager - User with Jenkins/Manage permissions (JEP-223)
    • readonly - User with Jenkins/SystemRead and read-only permissions (JEP-224) - announcement
    • user - User with ability to run jobs
  • Authorization:

Jobs and Folders

  • 3 Folders on the root level: Production, Development, System. Folders offer different permissions to users
  • Production and System folders implicitly load the ci.jenkins.io Pipeline Library
  • Development folder contains sandbox folders where common users can create and test their jobs
  • Each folder contains several reference Pipeline jobs

Nodes:

  • Master node is restricted for builds
  • Extra agents with linux label are available from the Docker Cloud, powered by Yet Another Docker Plugin
    • Maven cache is shared via the maven-repo volume
  • Master and agents offer the mvn and jdk8tools

Extra UI Features:

Usage

To start the demo instance, run the following command:

docker run --rm --name ci-jenkins-io-dev -v maven-repo:/root/.m2 -e DEV_HOST=${CURRENT_HOST} -p 8080:8080 -p 50000:50000 onenashev/demo-jenkins-config-as-code

The DEV_HOST environment variable is used to connect agents without using Docker-in-Docker. If you use Docker for Mac or Docker for Windows, use additional socat image for port forwarding to ensure that you can connect to the Docker VM on these platforms.

docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 2376:2375 bobrik/socat TCP4-LISTEN:2375,fork,reuseaddr UNIX-CONNECT:/var/run/docker.sock

Developing Pipeline libraries

In the Development folder there is a PipelineLib folder, which allows local building and testing of the library. This folder can be mapped to a local repository in order to develop the library without committing changes:

docker run --rm --name ci-jenkins-io-dev -v maven-repo:/root/.m2 -v ${MY_PIPELINE_LIBRARY_DIR}:/var/jenkins_home/pipeline-library -v ${MY_OTHER_PIPELINE_LIBS_DIRS}:/var/jenkins_home/pipeline-libs -e DEV_HOST=${CURRENT_HOST} -p 8080:8080 -p 50000:50000  onenashev/demo-jenkins-config-as-code

Once started, you can just start editing the Pipeline library locally. On every job start the changes will be reflected in the directory without committing anything.

Debugging Master

In order to debug the master, use the -e DEBUG=true -p 5005:5005 when starting the container. Jenkins will be suspended on the startup in such case.

If you open parent POM as a Maven project in your IDE, you will be also able to debug initialization Groovy scripts.

Building images

Agents

Having a local agent build is a prerequisite for using the master for high-speed builds with Maven repository caching. For this purpose there is a custom Dockerfile in the /agent folder.

cd agent && docker build -t onenashev/demo-jenkins-maven-builder .

Master

Build image:

docker build -t onenashev/demo-jenkins-config-as-code .

Release notes

See GitHub releases.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].