{"action":"created","comment":{"url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments/56357531","id":56357531,"diff_hunk":"@@ -1,981 +1,437 @@\n ---\n layout: simplepage\n-title: \"Pipeline\"\n+title: \"Getting Started with Pipelines\"\n ---\n \n-:toc:\n+== Audience and Purpose\n \n-# Jenkins Pipeline\n+This document is intended for novice users of the Jenkins pipeline feature. The document explains what a pipeline is, why that matters, and how to create the different kinds of pipelines.\n \n-Jenkins is a powerful, open source automation tool with a powerful plugin architecture that helps development teams automate their software lifecycle. Jenkins is used to power many industry-leading companies' software development pipelines.\n+== Why Pipeline?\n \n-Jenkins Pipeline is a powerful, first-class feature for managing complex, multi-step pipelines. Jenkins Pipeline, a set of open source plugins and integrations, brings the power of Jenkins and the plugin ecosystem into a scriptable Domain Specific Language (DSL). Best of all, like Jenkins core, Pipeline is extensible by third-party developers, supporting custom extensions to the Pipeline DSL and various options for plugin integration.\n+While standard Jenkins “freestyle” jobs support simple continuous integration by allowing you to define sequential tasks in an application lifecycle, they do not create a persistent record of execution, enable one script to address all the steps in a complex workflow, or confer the other advantages of pipelines.\n \n-Jenkins Pipeline was known as Jenkins Workflow prior to version 1.13.\n+In contrast to freestyle jobs, pipelines enable you to define the whole application lifecycle.  Pipeline functionality helps Jenkins to support continuous delivery (CD). The Pipeline plugin was built with community requirements for a flexible, extensible, and script-based CD workflow capability in mind. \n \n-![Pipeline Stage View UI](images/1-stage-view-ui-hr.png)\n-Pipeline Stage View UI\n+Accordingly, pipeline functionality is:\n \n-This Refcard provides an overview and introduction to Jenkins Pipeline as well as a full syntax reference card. We also provide a real-world delivery pipeline example, building on the more basic Pipeline snippets from earlier examples.\n+* Durable: Pipelines can survive both planned and unplanned restarts of your Jenkins master.\n+* Pausable: Pipelines can optionally stop and wait for human input or approval before completing the jobs for which they were built.\n+* Versatile: Pipelines support complex real-world CD requirements, including the ability to fork or join, loop, and work in parallel with each other.\n+* Efficient: Pipelines can restart from any of several saved checkpoints.\n+* Extensible: The Pipeline plugin supports custom extensions to its DSL (domain scripting language) and multiple options for integration with other plugins. \n \n-## Installing Jenkins Pipeline\n-It is assumed you have already installed Jenkins – either via the CloudBees Jenkins Platform or jenkins-ci.org. Jenkins Version 1.609.1+ is required.\n \n-* Open Jenkins in your web browser\n-* Navigate to Manage Jenkins > Manage Plugins\n-* Navigate to the Available tab, filter by Pipeline\n-* Select the Pipeline plugin and install\n-* Restart Jenkins\n+The flowchart below is an example of one continuous delivery scenario enabled by the Pipeline plugin:\n \n-This Refcard was written using Pipeline version 1.13. Installing the Pipeline plugin installs all necessary Pipeline dependencies and a new job type called Pipeline.\n+image::/images/pipeline/jenkins-workflow.png[title=\"Jenkins Workflow\", 800]\n \n-# Creating a Pipeline\n+== Pipeline Defined\n \n-Now that you have Jenkins running and have installed the Pipeline plugin, you are ready to create your first pipeline. Create a new pipeline by selecting New Item from the Jenkins home page.\n+Pipelines are Jenkins jobs enabled by the Pipeline (formerly called “workflow”) plugin and built with simple text scripts that use a Pipeline DSL (domain-specific language) based on the Groovy programming language. \n \n-First, give your pipeline a name, eg: \"hello-world-flow\".  pipelines are simple, Groovy scripts, so let's add the obligatory Hello World. Add a pipeline to the Pipeline script textarea:\n+Pipelines leverage the power of multiple steps to execute both simple and complex tasks according to parameters that you establish. Once created, pipelines can build code and orchestrate the work required to drive applications from commit to delivery.\n \n-```groovy\n-echo 'Hello world'\n-```\n+== Pipeline Vocabulary\n \n-Now save your pipeline, ensuring the Use Groovy Sandbox option is checked (more details to follow on this setting). Click Build Now to run your pipeline.\n+Pipeline terms such as “step,” “node,” and “stage” are a subset of the vocabulary used for Jenkins in general. \n \n-## Editing your Pipeline\n+Step::\n+    A “step” (often called a “build step”) is a single task that is part of sequence. Steps tell Jenkins what to do.\n \n-Because pipelines are simple text scripts, they are easy to edit. As you've seen, pipelines can be edited directly in the Jenkins UI when configuring your pipeline.\n+Node::\n+    In pipeline coding contexts, as opposed to Jenkins generally, a “node” is a step that does two things, typically by enlisting help from available executors on agents:\n+    * Schedules the steps contained within it to run by adding them to the Jenkins build queue (so that as soon as an executor slot is free on a node, the appropriate steps run). \n+    * Creates a workspace, meaning a file directory specific to a particular job, where resource-intensive processing can occur without negatively impacting your pipeline performance. Workspaces last for the duration of the tasks assigned to them.\n \n-![Pipeline Editor](images/2-workflow-edit-hr.png)\n \n-## Using the Snippet Generator\n-To make editing your pipelines easier, use the Snippet Generator. The Snippet Generator is dynamically populated with the latest Pipeline steps. Depending on the plugins installed in your environment, you may see more available steps.\n+(In Jenkins generally, a “node” means any computer that is part of your Jenkins installation, whether that computer is used as a master or as an agent).\n \n-![Snippet Generator](images/3-snippet-generator-hr.png)\n+Stage::\n+    A “stage” is a step that calls supported APIs. Pipeline syntax is comprised of stages. Each stage can have one or more build steps within it. ","path":"content/doc/pipeline/index.adoc","position":81,"original_position":81,"commit_id":"104e1a44735350a4043484b827561fe7641862c8","original_commit_id":"104e1a44735350a4043484b827561fe7641862c8","user":{"login":"rtyler","id":26594,"avatar_url":"https://avatars.githubusercontent.com/u/26594?v=3","gravatar_id":"","url":"https://api.github.com/users/rtyler","html_url":"https://github.com/rtyler","followers_url":"https://api.github.com/users/rtyler/followers","following_url":"https://api.github.com/users/rtyler/following{/other_user}","gists_url":"https://api.github.com/users/rtyler/gists{/gist_id}","starred_url":"https://api.github.com/users/rtyler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rtyler/subscriptions","organizations_url":"https://api.github.com/users/rtyler/orgs","repos_url":"https://api.github.com/users/rtyler/repos","events_url":"https://api.github.com/users/rtyler/events{/privacy}","received_events_url":"https://api.github.com/users/rtyler/received_events","type":"User","site_admin":false},"body":"> A \"stage\" is a step that calls supported APIs.\r\n\r\nThis doesn't make sense to me/doesn't tell me anything. Really a `stage` is a step that helps denote different parts of the execution. It's important to me that we communicate `node`, which has a Closure containing other steps, and `stage`, which is kind of a marker in a procedural sequence of steps, differently","created_at":"2016-03-16T15:43:24Z","updated_at":"2016-03-16T15:43:24Z","html_url":"https://github.com/jenkins-infra/jenkins.io/pull/136#discussion_r56357531","pull_request_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/136","_links":{"self":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments/56357531"},"html":{"href":"https://github.com/jenkins-infra/jenkins.io/pull/136#discussion_r56357531"},"pull_request":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/136"}}},"pull_request":{"url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/136","id":63007626,"html_url":"https://github.com/jenkins-infra/jenkins.io/pull/136","diff_url":"https://github.com/jenkins-infra/jenkins.io/pull/136.diff","patch_url":"https://github.com/jenkins-infra/jenkins.io/pull/136.patch","issue_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/136","number":136,"state":"open","locked":false,"title":"Pipeline getting started docs","user":{"login":"swashbuck1r","id":163845,"avatar_url":"https://avatars.githubusercontent.com/u/163845?v=3","gravatar_id":"","url":"https://api.github.com/users/swashbuck1r","html_url":"https://github.com/swashbuck1r","followers_url":"https://api.github.com/users/swashbuck1r/followers","following_url":"https://api.github.com/users/swashbuck1r/following{/other_user}","gists_url":"https://api.github.com/users/swashbuck1r/gists{/gist_id}","starred_url":"https://api.github.com/users/swashbuck1r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swashbuck1r/subscriptions","organizations_url":"https://api.github.com/users/swashbuck1r/orgs","repos_url":"https://api.github.com/users/swashbuck1r/repos","events_url":"https://api.github.com/users/swashbuck1r/events{/privacy}","received_events_url":"https://api.github.com/users/swashbuck1r/received_events","type":"User","site_admin":false},"body":"Initial Asciidoc conversion of pipeline getting started guide from @PaddyOH.","created_at":"2016-03-16T02:57:12Z","updated_at":"2016-03-16T15:43:24Z","closed_at":null,"merged_at":null,"merge_commit_sha":"905e8982f78e1c71d53e6b1bc35fa1869791412f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/136/commits","review_comments_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/136/comments","review_comment_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/136/comments","statuses_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/statuses/104e1a44735350a4043484b827561fe7641862c8","head":{"label":"swashbuck1r:pipeline-docs","ref":"pipeline-docs","sha":"104e1a44735350a4043484b827561fe7641862c8","user":{"login":"swashbuck1r","id":163845,"avatar_url":"https://avatars.githubusercontent.com/u/163845?v=3","gravatar_id":"","url":"https://api.github.com/users/swashbuck1r","html_url":"https://github.com/swashbuck1r","followers_url":"https://api.github.com/users/swashbuck1r/followers","following_url":"https://api.github.com/users/swashbuck1r/following{/other_user}","gists_url":"https://api.github.com/users/swashbuck1r/gists{/gist_id}","starred_url":"https://api.github.com/users/swashbuck1r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swashbuck1r/subscriptions","organizations_url":"https://api.github.com/users/swashbuck1r/orgs","repos_url":"https://api.github.com/users/swashbuck1r/repos","events_url":"https://api.github.com/users/swashbuck1r/events{/privacy}","received_events_url":"https://api.github.com/users/swashbuck1r/received_events","type":"User","site_admin":false},"repo":{"id":52469505,"name":"jenkins.io","full_name":"swashbuck1r/jenkins.io","owner":{"login":"swashbuck1r","id":163845,"avatar_url":"https://avatars.githubusercontent.com/u/163845?v=3","gravatar_id":"","url":"https://api.github.com/users/swashbuck1r","html_url":"https://github.com/swashbuck1r","followers_url":"https://api.github.com/users/swashbuck1r/followers","following_url":"https://api.github.com/users/swashbuck1r/following{/other_user}","gists_url":"https://api.github.com/users/swashbuck1r/gists{/gist_id}","starred_url":"https://api.github.com/users/swashbuck1r/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swashbuck1r/subscriptions","organizations_url":"https://api.github.com/users/swashbuck1r/orgs","repos_url":"https://api.github.com/users/swashbuck1r/repos","events_url":"https://api.github.com/users/swashbuck1r/events{/privacy}","received_events_url":"https://api.github.com/users/swashbuck1r/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/swashbuck1r/jenkins.io","description":"A static site for the Jenkins automation server","fork":true,"url":"https://api.github.com/repos/swashbuck1r/jenkins.io","forks_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/forks","keys_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/teams","hooks_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/hooks","issue_events_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/issues/events{/number}","events_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/events","assignees_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/assignees{/user}","branches_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/branches{/branch}","tags_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/tags","blobs_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/statuses/{sha}","languages_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/languages","stargazers_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/stargazers","contributors_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/contributors","subscribers_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/subscribers","subscription_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/subscription","commits_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/contents/{+path}","compare_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/merges","archive_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/downloads","issues_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/issues{/number}","pulls_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/pulls{/number}","milestones_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/milestones{/number}","notifications_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/labels{/name}","releases_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/releases{/id}","deployments_url":"https://api.github.com/repos/swashbuck1r/jenkins.io/deployments","created_at":"2016-02-24T19:42:56Z","updated_at":"2016-02-24T19:42:58Z","pushed_at":"2016-03-16T02:51:52Z","git_url":"git://github.com/swashbuck1r/jenkins.io.git","ssh_url":"git@github.com:swashbuck1r/jenkins.io.git","clone_url":"https://github.com/swashbuck1r/jenkins.io.git","svn_url":"https://github.com/swashbuck1r/jenkins.io","homepage":"https://jenkins-ci.org","size":33868,"stargazers_count":0,"watchers_count":0,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jenkins-infra:master","ref":"master","sha":"485287bb3de3187829637533176fa0965995169d","user":{"login":"jenkins-infra","id":7422698,"avatar_url":"https://avatars.githubusercontent.com/u/7422698?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkins-infra","html_url":"https://github.com/jenkins-infra","followers_url":"https://api.github.com/users/jenkins-infra/followers","following_url":"https://api.github.com/users/jenkins-infra/following{/other_user}","gists_url":"https://api.github.com/users/jenkins-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkins-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkins-infra/subscriptions","organizations_url":"https://api.github.com/users/jenkins-infra/orgs","repos_url":"https://api.github.com/users/jenkins-infra/repos","events_url":"https://api.github.com/users/jenkins-infra/events{/privacy}","received_events_url":"https://api.github.com/users/jenkins-infra/received_events","type":"Organization","site_admin":false},"repo":{"id":44886691,"name":"jenkins.io","full_name":"jenkins-infra/jenkins.io","owner":{"login":"jenkins-infra","id":7422698,"avatar_url":"https://avatars.githubusercontent.com/u/7422698?v=3","gravatar_id":"","url":"https://api.github.com/users/jenkins-infra","html_url":"https://github.com/jenkins-infra","followers_url":"https://api.github.com/users/jenkins-infra/followers","following_url":"https://api.github.com/users/jenkins-infra/following{/other_user}","gists_url":"https://api.github.com/users/jenkins-infra/gists{/gist_id}","starred_url":"https://api.github.com/users/jenkins-infra/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jenkins-infra/subscriptions","organizations_url":"https://api.github.com/users/jenkins-infra/orgs","repos_url":"https://api.github.com/users/jenkins-infra/repos","events_url":"https://api.github.com/users/jenkins-infra/events{/privacy}","received_events_url":"https://api.github.com/users/jenkins-infra/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jenkins-infra/jenkins.io","description":"A static site for the Jenkins automation server","fork":false,"url":"https://api.github.com/repos/jenkins-infra/jenkins.io","forks_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/forks","keys_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/teams","hooks_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/hooks","issue_events_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/events{/number}","events_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/events","assignees_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/assignees{/user}","branches_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/branches{/branch}","tags_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/tags","blobs_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/statuses/{sha}","languages_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/languages","stargazers_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/stargazers","contributors_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/contributors","subscribers_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/subscribers","subscription_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/subscription","commits_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/contents/{+path}","compare_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/merges","archive_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/downloads","issues_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues{/number}","pulls_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls{/number}","milestones_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/milestones{/number}","notifications_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/labels{/name}","releases_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/releases{/id}","deployments_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/deployments","created_at":"2015-10-24T22:02:57Z","updated_at":"2016-03-01T19:52:59Z","pushed_at":"2016-03-16T15:03:35Z","git_url":"git://github.com/jenkins-infra/jenkins.io.git","ssh_url":"git@github.com:jenkins-infra/jenkins.io.git","clone_url":"https://github.com/jenkins-infra/jenkins.io.git","svn_url":"https://github.com/jenkins-infra/jenkins.io","homepage":"https://jenkins-ci.org","size":34837,"stargazers_count":12,"watchers_count":12,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":44,"mirror_url":null,"open_issues_count":3,"forks":44,"open_issues":3,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/136"},"html":{"href":"https://github.com/jenkins-infra/jenkins.io/pull/136"},"issue":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/136"},"comments":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/136/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/136/comments"},"review_comment":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/136/commits"},"statuses":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/statuses/104e1a44735350a4043484b827561fe7641862c8"}}}}