Skip to content
master
Switch branches/tags
Go to file
Code

Latest commit

commit 39bb322
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 15:17:12 2020 +0000

    wip

commit 4a2bca9
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 15:16:34 2020 +0000

    wip

commit efeb016
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 15:15:53 2020 +0000

    wip

commit 11fadbf
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 15:14:00 2020 +0000

    wip

commit 13a4dab
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 15:13:19 2020 +0000

    wip

commit 8e20517
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 15:12:21 2020 +0000

    wip

commit ebb8644
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 15:11:30 2020 +0000

    Underscore

commit de38112
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 15:10:38 2020 +0000

    add object demo

commit 3da64c6
Author: Tom Donohue <monodot@users.noreply.github.com>
Date:   Mon Nov 16 15:06:48 2020 +0000

    Update Jenkinsfile.demo

commit 96ba56f
Author: Tom Donohue <monodot@users.noreply.github.com>
Date:   Mon Nov 16 15:05:25 2020 +0000

    Update Jenkinsfile.demo

commit 67c1dcb
Author: Tom Donohue <monodot@users.noreply.github.com>
Date:   Mon Nov 16 15:02:52 2020 +0000

    Update Jenkinsfile.demo

commit ec1b033
Author: Tom Donohue <monodot@users.noreply.github.com>
Date:   Mon Nov 16 15:02:10 2020 +0000

    Update Jenkinsfile.demo

commit 2991a10
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 14:58:20 2020 +0000

    Add GlobalVars

commit 438e419
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 14:55:28 2020 +0000

    Add example Jenkinsfile

commit 98ff1a3
Author: Tom Donohue <monodot@gmail.com>
Date:   Mon Nov 16 14:45:02 2020 +0000

    Update from master

commit 99f8d2e
Author: Tom Donohue <monodot@gmail.com>
Date:   Sun Mar 1 12:11:40 2020 +0000

    add envs

commit 0a8087c
Author: Tom Donohue <monodot@gmail.com>
Date:   Sun Mar 1 11:47:56 2020 +0000

    add envs

commit 0cd06eb
Author: Tom Donohue <monodot@gmail.com>
Date:   Sun Mar 1 11:45:54 2020 +0000

    add envs
4ee1f33

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 

README.md

pipeline-library-demo

Demonstrates how to use a Shared Library in Jenkins pipelines. This repository defines a single function, sayHello, which will echo a greeting.

Setup instructions

  1. In Jenkins, go to Manage Jenkins → Configure System. Under Global Pipeline Libraries, add a library with the following settings:

    • Name: pipeline-library-demo
    • Default version: Specify a Git reference (branch or commit SHA), e.g. master
    • Retrieval method: Modern SCM
    • Select the Git type
    • Project repository: https://github.com/monodot/pipeline-library-demo.git
    • Credentials: (leave blank)
  2. Then create a Jenkins job with the following pipeline (note that the underscore _ is not a typo):

    @Library('pipeline-library-demo')_
    
    stage('Demo') {
    
      echo 'Hello World'
    
      sayHello 'Dave'
    
    }
    

This will output the following from the build:

[Pipeline] stage
[Pipeline] { (Demo)
[Pipeline] echo
Hello world
[Pipeline] echo
Hello, Dave.
[Pipeline] }
[Pipeline] // stage
[Pipeline] End of Pipeline
Finished: SUCCESS

About

Demonstration of using a shared library in Jenkins

Topics

Resources

Releases

No releases published

Packages

No packages published

Languages