Code Monkey home page Code Monkey logo

retort's Introduction

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.

retort's People

Contributors

07071 avatar digital-scv avatar jigyoomin avatar yanghoon avatar

Watchers

 avatar  avatar  avatar  avatar  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.