GithubHelp home page GithubHelp logo

hkeeler / jenkins-shared-libraries Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cfpb/jenkins-shared-libraries

0.0 1.0 0.0 352 KB

License: Creative Commons Zero v1.0 Universal

Groovy 100.00%

jenkins-shared-libraries's Introduction

CFPB Jenkins Pipeline Shared Libraries

This is a collection of shared libraries to be used with Jenkins Pipelines

  • Technology stack: Written in groovy/Jenkins Pipeline DSL. Requires Jenkins
  • Status: This repo is intended to be an ongoing effort to collect useful Pipeline libraries.

Dependencies

This project is dependent on Jenkins Pipeline and Jenkins >= 2.46.3, though some earlier versions may work, they have not been tested.

Installation

These shared libraries may be accessed one of three ways:

  1. Add this repo to 'Global Pipeline Libraries' in the Jenkins UI.
  2. Include a libraries block in declarative pipeline syntax.
  3. Include this library in an @Library statement in a Pipeline script.

Global Pipeline Libraries

See this article about adding shared libraries via the Jenkins UI.

Within Pipeline Script

The declarative way to include libraries is the following.

libraries {
    lib('github.com/cfpb/jenkins-shared-libraries')
}

Since this repo is hosted on github.com, it's easy to include it in all script dynamically by adding it to the @Library block within a Pipeline script

@Library('github.com/cfpb/jenkins-pipeline-shared-libraries') _

Usage

Currently this repo has a sendEmail var that can be invoked after importing it. Once the entire shared library has been imported, sendEmail is available at the top level. E.g.

pipeline {
    agent { label "master" }

    libraries {
        lib('github.com/cfpb/jenkins-shared-libraries')
    }

    stages {
        stage("Echostage") {
            steps {
               echo "foo"
            }
        }
    }
    post {
        always {
            script {
                sendEmail(currentBuild, ['[email protected]'])
            }
        }
    }
}"""

TODO

Maybe because we no longer have the triggers, 'fixed' emails no longer have 'Fixed' in the subject line, but instead say 'Building'. It would be nice if we could figure out why this is, and then get the 'Fixed' label back in the subject line. Note however that emails about failing builds do still say 'Failure' and 'Still Failing' in the subject.

Getting help

If you have any trouble working with this repo, please open a github issue.

Getting involved

Adding libraries to this repo is welcome and encouraged. Should you have an idea for a useful library or an improvement for an existing one fork this repo and open a PR.

General instructions on contributing can be found in CONTRIBUTING.


Open source licensing info

  1. TERMS
  2. LICENSE
  3. CFPB Source Code Policy

Credits and references

  1. Jenkins Pipeline
  2. Jenkins Automation
  3. The wonderful Fabric8 repo

jenkins-shared-libraries's People

Contributors

scotchester avatar virtix avatar acrewdson avatar ascott1 avatar contolini avatar anselmbradford avatar yunghuffy avatar chosak avatar marcesher avatar

Watchers

James Cloos 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.