Giter Club home page Giter Club logo

jenkins-dry-in-pipelines's Introduction

Jenkins DRY in Pipelines

In software engineering, don't repeat yourself (DRY) is a principle of software development aimed at reducing repetition of all kinds.

Documentantion

The documentation with available functions can be found here.

Goal

The goal of this project is to provide useful generic functions to use with Shared Libraries feature of Jenkins Pipelines. These functions are often common to many pipelines causing code replication. With this grouping of functions it is possible to eliminate duplications by making pipeline files simpler and leaner. See the example below. (Both produce the same result)

Normal Jenkinsfile compare

Jenkinsfile using this project compare

How to use

It is necessary to import as functions of this project into your Jenkins. To do this, go to Manage Jenkins » Configure System » Global Pipeline Libraries and fill the following information.

global-pipeline-config

In the default version option choose the version you want to use. This project has tags following SEMVER, you can use them to get specific versions. To always use the latest version, complete with master and the master branch will be used.

If you prefer it's not necessary check Load implicitly option. If you don't use this option it will be necessary import manually this script using the following instruction in top of the Jenkinsfile.

@Library('jenkins-dry-in-pipelines') _

If you want to use a version other than the configured version you can tell this in import.

@Library('[email protected]') _

More details can be found here.

The examples in the documentation assume that the option has been checked, so the imports are not displayed

Contributing

If you have some function in your pipelines that you believe is generic enough feel free to submit a Pull Request.

In order to understand the operation of the scripts it is possible to observe the code of this project and the Jenkins Shared Libraries documentation.

Meta

Robson Bittencourt - @rluizv - [email protected]

Distributed under the MIT license. See LICENSE for more information.

https://github.com/robsonbittencourt/jenkins-dry-in-pipelines

jenkins-dry-in-pipelines's People

Contributors

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