1. 程式人生 > >pipeline之jenkins

pipeline之jenkins

pipeline




What is Jenkins Pipeline?

Jenkins Pipeline (or simply "Pipeline" with a capital "P") is a suite of plugins which supports implementing and integrating continuous delivery pipelines into Jenkins


A continuous delivery pipeline is an automated expression of your process for getting software from version control right through to your users and customers. Every change to your software (committed in source control) goes through a complex process on its way to being released. This process involves building the software in a reliable and repeatable manner, as well as the progression of the built software (called a "build") through multiple stages of testing and deployment.


Typically, the definition of a Jenkins Pipeline is written into a text file (called a Jenkinsfile) which in turn is checked into a project’s source control repository. [2] This is the foundation of "Pipeline-as-Code"; treating the continuous delivery pipeline a part of the application to be versioned and reviewed like any other code. Creating aJenkinsfile

provides a number of immediate benefits:

  • Automatically create Pipelines for all Branches and Pull Requests

  • Code review/iteration on the Pipeline

  • Audit trail for the Pipeline

  • Single source of truth [3] for the Pipeline, which can be viewed and edited by multiple members of the project.





Jenkins Pipeline

https://jenkins.io/doc/book/pipeline/


https://jenkins.io/doc/book/pipeline/#overview


https://wiki.jenkins.io/display/JENKINS/Pipeline+Plugin




















初試Jenkins2.0 Pipeline持續集成


Pipeline的幾個基本概念:

  • Stage: 階段,一個Pipeline可以劃分為若幹個Stage,每個Stage代表一組操作。註意,Stage是一個邏輯分組的概念,可以跨多個Node。

  • Node: 節點,一個Node就是一個Jenkins節點,或者是Master,或者是Agent,是執行Step的具體運行期環境。

  • Step: 步驟,Step是最基本的操作單元,小到創建一個目錄,大到構建一個Docker鏡像,由各類Jenkins Plugin提供。



,Jenkins 2.0的精髓是Pipeline as Code,是幫助Jenkins實現CI到CD轉變的重要角色。什麽是Pipeline,簡單來說,就是一套運行於Jenkins上的工作流框架,將原本獨立運行於單個或者多個節點的任務連接起來,實現單個任務難以完成的復雜發布流程。Pipeline的實現方式是一套Groovy DSL,任何發布流程都可以表述為一段Groovy腳本,並且Jenkins支持從代碼庫直接讀取腳本,從而實現了Pipeline as Code的理念。


http://blog.csdn.net/aixiaoyang168/article/details/72818804







Jenkins 2.0

Jenkins 2.0新特性:Pipeline as code,全新的開箱體驗和UI可用性提升以及完全向後兼容。

  • Pipeline as Code
    通過使用Groovy DSL來描述一套運行於Jenkins上的工作流程,將原本獨立運行於單個或者多個節點的任務連接起來,實現單個任務難以完成的復雜發布流程。並且,Jenkins支持從代碼庫直接讀取腳本。

  • 全新的開箱體驗和UI可用性提升
    Jenkins 1.XXX 安裝默認是開放所有權限,因為安全性存在隱患。而Jenkins 2.0則加強了安全管理。

  • 完全向後兼容
    Jenkins官方公布是完全向後兼容的,所以在Jenkins 1.XXX版本的功能都可以使用,但插件還是得自己驗證

這套持續交付的方案,最大的兩個特性在於,一,使用了Jenkins Pipeline Project,通過Jenkinsfile腳本簡化整個配置過程,增加了artifacts存儲,加強了結果展示,UT結果看板以及stage時間統計。二,Dynamic slave,提供了動態生成slave,執行Jenkins job,銷毀slave的能力。



使用阿裏雲容器服務Jenkins 2.0實現持續集成之Pipeline篇(updated on 2016.12.23)

https://yq.aliyun.com/articles/64970

https://github.com/AliyunContainerService/jenkins-slaves







本文出自 “運維自動化” 博客,請務必保留此出處http://shower.blog.51cto.com/4926872/1972158

pipeline之jenkins