项目作者: capralifecycle

项目描述 :
Jenkins pipeline library for Liflig
高级语言: Groovy
项目地址: git://github.com/capralifecycle/jenkins-pipeline-library.git
创建时间: 2017-07-23T01:37:34Z
项目社区:https://github.com/capralifecycle/jenkins-pipeline-library

开源协议:Apache License 2.0

下载


Jenkins2 pipeline library

Used to store common code used in Jenkins pipelines.

This is set up as a library named ‘cals’ in Jenkins.

https://jenkins.io/doc/book/pipeline/shared-libraries/

Inspiration sources:

Adding changes

The master branch is protected, so changes will have to be made
in a branch first, then passing as a build, before updating master to
point to that commit. No separate merge commit is needed.

The status of the commit can be tracked by comparing changes to master,
e.g. https://github.com/capralifecycle/jenkins-pipeline-library/compare/next
if pushing to the next branch.

This is done to reduce the probability that changes cause all
build in Jenkins fail due to introducing a faulty change.

Using the library

The main use of the library is exporting methods that can be used in other
pipelines to keep things DRY. All files present in vars directory will
be available as methods when this library is imported.

The best way to get started is looking at other projects. Examples:

Testing changes to pipeline library

If changes to the library causes it to fail running it will most probably
break most builds in Jenkins.

A safe way of testing changes:

  • Push changes to a feature branch

  • Reference the branch when using the library:

  1. // In Jenkinsfile of another repo
  2. @Library('cals@my-feature-branch') _

If you don’t want to modify master of another project just to test it,
you should be able to apply it to a branch in that project as well as
long as it will automatically build in Jenkins.