Git Product home page Git Product logo

jenkins-shared-library's Introduction

Jenkins Shared Library

CircleCI

This is my personal Jenkins Shared Library.

This repository contains a library of Jenkins Global Variables & Helper Variables that I can use in my project's Jenkinsfile

Based on the following articles:

Usage

Import Library

As per the instructions on the [Jenkins Documentation], to include this library; in your Jenkinsfile:

@Library('[email protected]') _

note that the name is the id of the Shared Library configured under Jenkins Configuration and the version after the @ sign can be master which points to the master branch of this library or simply omitted which would pick up the default version configured under Jenkins Configuration (if you have it configured there).

Using Global Variables

To use one of the global variables or helper variables defined in this library you just simply call it like the following examples.

@Library('[email protected]') _
buildJavaApp(repo: "name of repo")
@Library('[email protected]') _
buildJavaAppDockerFull(repo: "name of repo", microserviceName: "example-app")

See under vars/ to see list of full available Global Variables/Helper Variables to use.

Alternatively, you can check out this example demo project which shows some use cases of this Shared Library: Jenkins Pipelines

Configuration

A lot of the configuration for external systems (Github, SonarQube etc) are set in the Constants.groovy constants class. You can edit this to match according to your settings.

Gloval Vars Documentation

Each of the global variables (helper functions) has its own documentation (corresponding *.txt file). You can access these documentation on the Global Variable Reference link on the navigation sidebar of pipeline jobs that imported this shared library.

Note that as per Jenkins documentation this is only visible after one successful run of the pipeline job for the documentation to be generated.

The documentation is in (.txt) file format and contains HTML.

Release Notes

v0.0.2

  • global variables documentation
  • new log levels (fatal, trace) to log utility
  • support for sonar in pipeline jobs

v0.0.1

  • basic Global Variables (steps) to build:
    • a Java App
    • a full pipeline of building a Java App (from checkout to deployment)
  • Library classes to:
    • build Docker Image
    • Push Docker Image to AWS ECR (Elastic Container Registry) - AWS's Docker Registry
    • basic Git helper commands
  • utilities
    • logging
    • notifications
  • Unit Tests using Jenkins-Spock

jenkins-shared-library's People

Contributors

colinbut avatar dependabot[bot] avatar

Watchers

 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.