• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

wcm-io-devops/jenkins-pipeline-library: wcm.io Jenkins Pipeline Library for CI/C ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

wcm-io-devops/jenkins-pipeline-library

开源软件地址(OpenSource Url):

https://github.com/wcm-io-devops/jenkins-pipeline-library

开源编程语言(OpenSource Language):

Groovy 99.7%

开源软件介绍(OpenSource Introduction):

Build Maven Central Sonatype Snapshots

Jenkins Pipeline Library

Since Jenkins Pipeline has reached a certain state of production scripted pipelines are the way to go.

But: Not everything known from the UI is available in Pipeline and configuring and writing scripts is not so easy for the normal developer.

The target of this library is to take out some complexity (and yes adding some too) of the pipeline creation and to bring back some known functionality (for example GIT_BRANCH and SCM_URL environment variables, mail notification on still unstable etc.)

Want to see an example? Have look at Usage examples

Table of contents

Key concepts

The pipeline library was developed with a focus to ease Java and Maven build processes within companies which have a more or less similiar project structure e.g.

  • Maven/Java
  • local Artifact Server (like Sonatype Nexus or Artifactory)
  • GIT

The assumption is that in these environments

  • Jenkins has a dedicated user account to checkout code (or one per project)
  • the artifact server caches public artifacts and acts as a internal artifact server

So why configure maven repositories and scm credentials in every pipeline?

So the key concepts of the pipeline enable you to

  • Auto provide credentials (no worries, only Jenkins credential ids, not the credential itself) (see Credentials)
  • Auto provide maven settings (see ManagedFiles)
  • configure each job the same way (see ConfigStructure)
  • log and see the things you are interested in (see Logging)

to builds.

Running this pipeline library will result in more structured and easier to maintain pipeline scripts.

Configured properly this library enables you to checkout scm with these lines of code:

import static io.wcm.devops.jenkins.pipeline.utils.ConfigConstants.*
checkoutScm( (SCM) : [
        (SCM_URL) : "[email protected]/group/project.git",
    ]
)

Or running maven with local and global maven settings with these lines of code:

import static io.wcm.devops.jenkins.pipeline.utils.ConfigConstants.*
execMaven( 
    (SCM) : [
        (SCM_URL) : "[email protected]/group/project.git",
    ],
    (MAVEN): [
        (MAVEN_GOALS) : [ "clean", "install" ]
    ]
)

Looking for an example on how a pipeline script looks like when using Pipeline? Have a look at Usage examples


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap