Skip to content

iscooter/nopipeline-containers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jenkins JSON Pipeline Build Status

This project aims to demonstrate how to execute pipeline-like Jenkins jobs represented in a JSON structure.

Technology Stack

Item Type Product Referece Project Ref
make script https://www.gnu.org/s/make/manual/make.html MakeFile
docker platform service https://www.docker.com/ Dockerfiles
docker-compose tool https://docs.docker.com/compose/ docker-compose.yml
jenkins ci/cd https://jenkins.io/
dsl script https://jenkins.io/doc/book/pipeline/syntax/ jsonPipeline.groovy
groovy language https://groovy-lang.org/documentation.html nopipeline
python language https://docs.python.org/3/

Usage

Following a resemblance of the 3musketeers pattern Makefile is used to build and run Jenkins locally, but also enable executing from CI tools that integrate with Docker and make.

Start the Jenkins contianers

make run-jenkins

Login to Jenkins

Using the credentials below for http://localhost:8080

  • user admin
  • password admin

Running the JSON noPipeline

Find the Jenkins job json-nopipeline and click Build Now. Access the jenkins build console to see the output.

Stopping Jenkins

Backup /var/jenkins_home and update plugins.txt.

make stop-jenkins

Jenkins Pipeline Script

The JSON noPipeline implements a lightweight Jenkins scripted pipeline that includes a Jenkins shared library. The jsonPipeline interprets the JSON to dynamically execute pipeline-like stages.

// include the shared library
jsl = library(
    identifier: "jsl@master",
    retriever: modernSCM([
        $class: 'GitSCMSource',
        remote: 'https://github.com/iscooter/nopipeline-jsl.git'
    ])
)
 
// start the pipeline
wrapper(
    pipeline: "json",
    library: jsl,
    json: "hello-world"
)

JSON Pipeline Structure

The functional container integration is coming soon. The hello-world.json is available to the pipeline as a resource in one of the Jenkins shared libraries.

{
    "DockerContainer": "amazonlinux",
    "Pipeline": {
        "Stage1": {
            "State": "Enabled",
            "LogLevel": "INFO",
            "Payload": {
                "arg1": "hello-world"
            }
        }
    }
}

Credits

Resources

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published