Skip to content

cnpst/retort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

Usage

You don't need to create complex Jenkinsfile for Pipeline. Instead, configure the pipline using a yaml and Jenkinsfile that contain single method call.

Set up Your Project

Create two file in your project root.

pipeline.yaml (Pipeline Config)

sample pipeline.yaml

# Define your dynamic pipeline stage
# - Details will be configured as same name
stage:
- build
- deploy

# configuration for 'build' stage.
# - keys are will be used as container name (maven and docker)
# - values are will be executed as shell command
build:
- maven: mvn --version
- docker: docker version

# configuration for 'build' stage. (no effect now)
deploy:
- k8s: k8s/*.yaml

# configuration for creating slave at k8s
agent:
  containers:
  - name: maven
    image: maven:3.3.9-jdk-8-alpine
    ttyEnabled: true
    command: cat
  - name: docker
    image: docker
    ttyEnabled: true
    command: cat
  volumes:
  - hostPathVolume:
      hostPath: '/var/run/docker.sock'
      mountPath: '/var/run/docker.sock'

Jenkinsfile (Scratch)

sample Jenkinsfile

// Just add a below simple Jenkinsfile.
// This code will execute a pipeline that is prepared as pipeline shared library.
@Library('retort') _
heat()

Execute Pipeline Job

Create Pipeline Job with SCM

To use prepared pipeline, select definition type as Pipeline script from SCM. Write down your repository info. And also click add button for creating credentials, if you use private repository.

Result of Job Execution

The library load your configration(.yaml) at *prepared stage. And then detect two stages using those config. Stages are run at k8s and master. In k8s, run and print version of tools by configured shell script.

On Blue Ocean

You can also see pipelines throught Jenkins Blue Ocean.

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published