Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Demonstration of using a shared library in Jenkins

NotificationsYou must be signed in to change notification settings

tutorialworks/pipeline-library-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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. UnderGlobal 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 theGit 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] echoHello world[Pipeline] echoHello, Dave.[Pipeline] }[Pipeline] // stage[Pipeline] End of PipelineFinished: SUCCESS

About

Demonstration of using a shared library in Jenkins

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp