{"id":167,"date":"2017-04-12T22:29:28","date_gmt":"2017-04-12T14:29:28","guid":{"rendered":"http:\/\/www.jsjs.org\/?p=167"},"modified":"2017-04-12T22:29:28","modified_gmt":"2017-04-12T14:29:28","slug":"pipeline-as-code-with-jenkins","status":"publish","type":"post","link":"https:\/\/blog.jsjs.org\/?p=167","title":{"rendered":"Pipeline as Code with Jenkins"},"content":{"rendered":"<div class=\"paragraph\">\n<p>The default interaction model with Jenkins, historically, has been very web UI driven, requiring users to manually create jobs, then manually fill in the details through a web browser. This requires additional effort to create and manage jobs to test and build multiple projects, it also keeps the configuration of a job to build\/test\/deploy separate from the actual code being built\/tested\/deployed. This prevents users from applying their existing CI\/CD best practices to the job configurations themselves.<\/p>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"pipeline\">Pipeline<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>With the introduction of the <a href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/Pipeline+Plugin\">Pipeline plugin<\/a>, users now can implement a project\u2019s entire build\/test\/deploy pipeline in a <code>Jenkinsfile<\/code> and store that alongside their code, treating their pipeline as another piece of code checked into source control.<\/p>\n<\/div>\n<div class=\"paragraph\">\n<p>The Pipeline plugin was inspired by the <a href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/Build+Flow+Plugin\">Build Flow plugin<\/a> but aims to improve upon some concepts explored by Build Flow with features like:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li>the ability to suspend\/resume of executing jobs.<\/li>\n<li>checking the pipeline definition into source control (<code>Jenkinsfile<\/code>)<\/li>\n<li>support for extending the domain specific language with additional, organization specific steps, via the &#8220;<a href=\"https:\/\/jenkins.io\/doc\/book\/pipeline\/shared-libraries\/\">Shared Libraries<\/a>&#8221; feature.<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>In an adjacent space is the <a href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/Job+DSL+Plugin\">Job DSL plugin<\/a> which is worth mentioning as well.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"getting-started\">Getting Started<\/h2>\n<div class=\"sectionbody\">\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/jenkins.io\/doc\/pipeline\">Getting Started with Pipeline<\/a><\/li>\n<li>The <a href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/Pipeline+Plugin\">Pipeline plugin<\/a> has a fairly comprehensive <a href=\"https:\/\/github.com\/jenkinsci\/pipeline-plugin\/blob\/master\/TUTORIAL.md\">tutorial<\/a> checked into its source tree too.<\/li>\n<li><a href=\"https:\/\/go.cloudbees.com\/docs\/cloudbees-documentation\/cookbook\/ch13.html#ch13__continuous_delivery_with_jenkins_pipeline\">Overview of Continuous Delivery with Pipeline<\/a><\/li>\n<li><a href=\"https:\/\/dzone.com\/refcardz\/continuous-delivery-with-jenkins-workflow\">DZone Refcard<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"demos\">Demos<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>Demonstrations of Pipeline functionality you can run locally.<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/hub.docker.com\/r\/jenkinsci\/workflow-demo\/\">continuous delivery<\/a><\/li>\n<li><a href=\"https:\/\/hub.docker.com\/r\/jenkinsci\/pipeline-as-code-github-demo\/\">GitHub organization folders<\/a><\/li>\n<li><a href=\"https:\/\/hub.docker.com\/r\/jenkinsci\/parallel-test-executor-demo\/\">running tests in parallel<\/a><\/li>\n<li><a href=\"https:\/\/hub.docker.com\/r\/jenkinsci\/docker-workflow-demo\/\">build, test, and publish with Docker<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"additional-resources\">Additional resources<\/h2>\n<div class=\"sectionbody\">\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/Pipeline+Plugin\">Pipeline Plugin page<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/jenkinsci\/workflow-plugin\/blob\/master\/COMPATIBILITY.md\">Plugins compatible with Workflow<\/a><\/li>\n<li><a href=\"http:\/\/stackoverflow.com\/questions\/tagged\/jenkins-workflow\">Stack Overflow &#8220;jenkins-workflow&#8221; tag<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/jenkinsci\/workflow-examples\">Examples\/snippets repository<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"sect1\">\n<h2 id=\"presentations\">Presentations<\/h2>\n<div class=\"sectionbody\">\n<div class=\"paragraph\">\n<p>The presentations below were given by <a href=\"https:\/\/github.com\/jglick\">Jesse Glick<\/a>, author of the <a href=\"https:\/\/wiki.jenkins-ci.org\/display\/JENKINS\/Pipeline+Plugin\">Pipeline Plugin<\/a><\/p>\n<\/div>\n<p><center><iframe loading=\"lazy\" src=\"https:\/\/www.youtube-nocookie.com\/embed\/VkIzoU7zYzE\" width=\"560\" height=\"315\" frameborder=\"0\" data-mce-fragment=\"1\"><\/iframe><\/center><\/p>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"https:\/\/www.youtube.com\/watch?v=gpaV6x9QwDo\">2014 presentation<\/a> (with <a href=\"https:\/\/www.cloudbees.com\/sites\/default\/files\/2014-0618-Boston-Jesse_Glick-Workflow.pdf\">slides<\/a>)<\/li>\n<\/ul>\n<\/div>\n<div class=\"paragraph\">\n<p>Other presentations:<\/p>\n<\/div>\n<div class=\"ulist\">\n<ul>\n<li><a href=\"http:\/\/www.slideshare.net\/cloudbees\/pimp-your-continuous-delivery-pipeline-with-jenkins-workflow-wjax-14\">Pimp your Continuous Delivery Pipeline with Jenkins workflow (W-JAX 14)<\/a> by <a href=\"https:\/\/github.com\/cyrille-leclerc\">Cyrille Le Clerc<\/a><\/li>\n<\/ul>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The default interaction model with Jenkins, historically, has been very web UI driven, requiring users to manually create jobs, then [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[1],"tags":[],"class_list":["post-167","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/167","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=167"}],"version-history":[{"count":0,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=\/wp\/v2\/posts\/167\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=167"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=167"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.jsjs.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=167"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}