{"action":"created","comment":{"url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments/92894680","pull_request_review_id":13412511,"id":92894680,"diff_hunk":"@@ -0,0 +1,111 @@\n+---\n+layout: post\n+title: \"Declaring the Beta Release of Declarative Pipeline Syntax\"\n+tags:\n+- pipeline\n+- newfeatures\n+- blueocean\n+author: hrmpw\n+---\n+\n+This week we released version 0.71 of the link:https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Model+Definition+Plugin[_Pipeline-Model-Defintion_] plugin and wanted to crown it as the official Beta version of the Declarative Pipeline syntax. Although it has been available in the update center since August, we have waited to recommend it for all of your Pipeline needs while we work out the kinks and solidify the syntax. We think this release is getting pretty close to the final version, but it is still a Beta and might change before 1.0.\n+\n+== What is Declarative Pipeline?\n+\n+All the way back at Jenkins World in September, Andrew Bayer presented a link:https://www.cloudbees.com/introducing-new-way-define-jenkins-pipelines[sneak peak] of a new syntax for constructing Pipelines. We are calling this new syntax Declarative Pipeline to differentiate it from the existing Scripted Pipeline syntax that has always been a part of Pipeline.\n+\n+After listening to many Jenkins users over the last year we felt that, while Scripted Pipeline provides tremendous power, flexibility, and extensibility, the learning curve for the DSL was steep for users new to either Jenkins or Pipeline. Beginning users wanting to take advantage of all the features provided by Pipeline and Jenkinsfiles were forced to learn the DSL or remain limited to the functionality provided by Freestyle jobs.\n+\n+Declarative Pipeline does not replace Pipeline but extends it with a pre-defined structure to let users focus entirely on the `steps` required at each `stage` without needing to worry about scripting every aspect of the pipeline. Granular flow-control is extremely powerful and Scripted Pipeline syntax will always be part of Pipeline but it's not for everyone.\n+\n+Declarative Pipeline enables all users to connect simple, declarative blocks that define build agents (including Docker), post build actions, environment settings, credentials and all stages that make up the pipeline. Best of all, because this Declarative syntax is part of Pipeline, all build steps and build wrappers available in Plugins or loaded from Shared Libraries are also available as `steps` in Declarative.\n+\n+== Example\n+\n+The following Pipelines should execute the same steps. The first shows the Declarative syntax and the second shows the original Scripted syntax. The Declarative syntax has a more straightforward structure that is easier to grok by users not versed in Groovy.\n+\n+[pipeline]\n+----\n+// Declarative //\n+pipeline {\n+    agent  label:'has-docker', dockerfile: true\n+    environment {\n+        GIT_COMMITTER_NAME = \"jenkins\"\n+        GIT_COMMITTER_EMAIL = \"jenkins@jenkins.io\"\n+    }\n+    post {\n+        always {\n+          deleteDir()\n+        }\n+        success {\n+            mail to:\"me@example.com\", subject:\"SUCCESS: ${currentBuild.fullDisplayName}\", body: \"Yay, we passed.\"\n+        }\n+        failure {\n+            mail to:\"me@example.com\", subject:\"FAILURE: ${currentBuild.fullDisplayName}\", body: \"Boo, we failed.\"\n+        }\n+    }\n+    stages {\n+        stage(\"Build\") {\n+          steps {\n+            sh 'mvn clean install -Dmaven.test.failure.ignore=true'\n+          }\n+        }\n+        stage(\"Archive\"){\n+          steps {\n+            archive \"*/target/**/*\"\n+            junit '*/target/surefire-reports/*.xml'\n+          }\n+        }\n+    }\n+}\n+\n+// Script //\n+withEnv([\"GIT_COMMITTER_NAME = jenkins\",\"GIT_COMMITTER_EMAIL = jenkins@jenkins.io\"]) {\n+  node('has-docker') {\n+    try {\n+      checkout scm // checks out Dockerfile and source code\n+      def myImage = docker.build 'my-environment:snapshot'\n+      myImage.inside {\n+        stage('Build') {\n+          sh 'mvn clean install -Dmaven.test.failure.ignore=true'\n+        }\n+        stage('Archive') {\n+          archive \"*/target/**/*\"\n+          junit '*/target/surefire-reports/*.xml'\n+        }\n+      }\n+      if (currentBuild.result == null || currentBuild.result == 'SUCCESS') {\n+        mail to:\"me@example.com\", subject:\"SUCCESS: ${currentBuild.fullDisplayName}\", body: \"Yay, we passed.\"\n+      }\n+    }\n+    catch (exc) {\n+      if (currentBuild.result == 'FAILURE') {\n+        mail to:\"me@example.com\", subject:\"FAILURE: ${currentBuild.fullDisplayName}\", body: \"Boo, we failed.\"\n+      }\n+    }\n+    finally {\n+      deleteDir()\n+    }\n+  }\n+}\n+----\n+\n+== How can you help?\n+\n+1. Install the lastest version of the link:https://wiki.jenkins-ci.org/display/JENKINS/Pipeline+Model+Definition+Plugin[_Pipeline-Model-Defintion_] plugin.\n+2. Read the documentation: link:https://github.com/jenkinsci/pipeline-model-definition-plugin/wiki/getting%20started[Getting Started] and link:https://github.com/jenkinsci/pipeline-model-definition-plugin/blob/master/SYNTAX.md[Syntax overview].  (These documents will be incorporated into the Jenkins.io documentation.)\n+3. Convert some of your existing Pipeline scripts into Declarative\n+4. Log any issues or enhancements you have link:https://issues.jenkins-ci.org/browse/JENKINS-40493[here] for the syntax, the execution, or the documentation.\n+5. Ask questions. You can send questions to the link:mailto:jenkinsci-users@googlegroups.com[users mailing list] or visit the #jenkins channel on IRC.\n+\n+== How will this work with Blue Ocean?\n+\n+Blue Ocean is all about pipelines in Jenkins. Running pipelines, displaying pipelines, and, soon, creating pipelines. As part of Pipeline Blue Ocean will be able to run and display Pipelines written in this new syntax just like any other Pipeline works today. However, because Declarative Pipeline includes a pre-defined structure, or model, it is now possible to create and edit pipelines with a GUI editor.\n+\n+Although we plan to launch 1.0 of Declarative Pipeline before Blue Ocean is officially available we expect to have a working Beta of the Editor available to play with. The combination of a simple syntax model and an intuitive editor should make Pipeline creation a breeze.","path":"content/blog/2016/2016-12-16-declarative-pipeline-beta.adoc","position":105,"original_position":105,"commit_id":"e17bb8dc2396275e11fdeb876fb2d77058e6a8eb","original_commit_id":"e17bb8dc2396275e11fdeb876fb2d77058e6a8eb","user":{"login":"bitwiseman","id":1958953,"avatar_url":"https://avatars.githubusercontent.com/u/1958953?v=3","gravatar_id":"","url":"https://api.github.com/users/bitwiseman","html_url":"https://github.com/bitwiseman","followers_url":"https://api.github.com/users/bitwiseman/followers","following_url":"https://api.github.com/users/bitwiseman/following{/other_user}","gists_url":"https://api.github.com/users/bitwiseman/gists{/gist_id}","starred_url":"https://api.github.com/users/bitwiseman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bitwiseman/subscriptions","organizations_url":"https://api.github.com/users/bitwiseman/orgs","repos_url":"https://api.github.com/users/bitwiseman/repos","events_url":"https://api.github.com/users/bitwiseman/events{/privacy}","received_events_url":"https://api.github.com/users/bitwiseman/received_events","type":"User","site_admin":false},"body":"\"available, we expect\"","created_at":"2016-12-16T22:08:32Z","updated_at":"2016-12-16T22:08:57Z","html_url":"https://github.com/jenkins-infra/jenkins.io/pull/504#discussion_r92894680","pull_request_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/504","_links":{"self":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/comments/92894680"},"html":{"href":"https://github.com/jenkins-infra/jenkins.io/pull/504#discussion_r92894680"},"pull_request":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/504"}}},"pull_request":{"url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/504","id":98263789,"html_url":"https://github.com/jenkins-infra/jenkins.io/pull/504","diff_url":"https://github.com/jenkins-infra/jenkins.io/pull/504.diff","patch_url":"https://github.com/jenkins-infra/jenkins.io/pull/504.patch","issue_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/504","number":504,"state":"open","locked":false,"title":"Beta blog","user":{"login":"HRMPW","id":1216602,"avatar_url":"https://avatars.githubusercontent.com/u/1216602?v=3","gravatar_id":"","url":"https://api.github.com/users/HRMPW","html_url":"https://github.com/HRMPW","followers_url":"https://api.github.com/users/HRMPW/followers","following_url":"https://api.github.com/users/HRMPW/following{/other_user}","gists_url":"https://api.github.com/users/HRMPW/gists{/gist_id}","starred_url":"https://api.github.com/users/HRMPW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HRMPW/subscriptions","organizations_url":"https://api.github.com/users/HRMPW/orgs","repos_url":"https://api.github.com/users/HRMPW/repos","events_url":"https://api.github.com/users/HRMPW/events{/privacy}","received_events_url":"https://api.github.com/users/HRMPW/received_events","type":"User","site_admin":false},"body":"Adding a blog post for the Declarative Pipeline beta blog.\r\n\r\n@abayer @i386 @rtyler @michaelneale @rsandell","created_at":"2016-12-16T01:28:16Z","updated_at":"2016-12-16T22:08:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c4d88029ba261176984608fc7ce69d5925fe874c","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/504/commits","review_comments_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/504/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/504/comments","statuses_url":"https://api.github.com/repos/jenkins-infra/jenkins.io/statuses/e17bb8dc2396275e11fdeb876fb2d77058e6a8eb","head":{"label":"HRMPW:beta-blog","ref":"beta-blog","sha":"e17bb8dc2396275e11fdeb876fb2d77058e6a8eb","user":{"login":"HRMPW","id":1216602,"avatar_url":"https://avatars.githubusercontent.com/u/1216602?v=3","gravatar_id":"","url":"https://api.github.com/users/HRMPW","html_url":"https://github.com/HRMPW","followers_url":"https://api.github.com/users/HRMPW/followers","following_url":"https://api.github.com/users/HRMPW/following{/other_user}","gists_url":"https://api.github.com/users/HRMPW/gists{/gist_id}","starred_url":"https://api.github.com/users/HRMPW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HRMPW/subscriptions","organizations_url":"https://api.github.com/users/HRMPW/orgs","repos_url":"https://api.github.com/users/HRMPW/repos","events_url":"https://api.github.com/users/HRMPW/events{/privacy}","received_events_url":"https://api.github.com/users/HRMPW/received_events","type":"User","site_admin":false},"repo":{"id":70645988,"name":"jenkins.io","full_name":"HRMPW/jenkins.io","owner":{"login":"HRMPW","id":1216602,"avatar_url":"https://avatars.githubusercontent.com/u/1216602?v=3","gravatar_id":"","url":"https://api.github.com/users/HRMPW","html_url":"https://github.com/HRMPW","followers_url":"https://api.github.com/users/HRMPW/followers","following_url":"https://api.github.com/users/HRMPW/following{/other_user}","gists_url":"https://api.github.com/users/HRMPW/gists{/gist_id}","starred_url":"https://api.github.com/users/HRMPW/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HRMPW/subscriptions","organizations_url":"https://api.github.com/users/HRMPW/orgs","repos_url":"https://api.github.com/users/HRMPW/repos","events_url":"https://api.github.com/users/HRMPW/events{/privacy}","received_events_url":"https://api.github.com/users/HRMPW/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/HRMPW/jenkins.io","description":"A static site for the Jenkins automation server","fork":true,"url":"https://api.github.com/repos/HRMPW/jenkins.io","forks_url":"https://api.github.com/repos/HRMPW/jenkins.io/forks","keys_url":"https://api.github.com/repos/HRMPW/jenkins.io/keys{/key_id}","collaborators_url":"https://api.github.com/repos/HRMPW/jenkins.io/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/HRMPW/jenkins.io/teams","hooks_url":"https://api.github.com/repos/HRMPW/jenkins.io/hooks","issue_events_url":"https://api.github.com/repos/HRMPW/jenkins.io/issues/events{/number}","events_url":"https://api.github.com/repos/HRMPW/jenkins.io/events","assignees_url":"https://api.github.com/repos/HRMPW/jenkins.io/assignees{/user}","branches_url":"https://api.github.com/repos/HRMPW/jenkins.io/branches{/branch}","tags_url":"https://api.github.com/repos/HRMPW/jenkins.io/tags","blobs_url":"https://api.github.com/repos/HRMPW/jenkins.io/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/HRMPW/jenkins.io/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/HRMPW/jenkins.io/git/refs{/sha}","trees_url":"https://api.github.com/repos/HRMPW/jenkins.io/git/trees{/sha}","statuses_url":"https://api.github.com/repos/HRMPW/jenkins.io/statuses/{sha}","languages_url":"https://api.github.com/repos/HRMPW/jenkins.io/languages","stargazers_url":"https://api.github.com/repos/HRMPW/jenkins.io/stargazers","contributors_url":"https://api.github.com/repos/HRMPW/jenkins.io/contributors","subscribers_url":"https://api.github.com/repos/HRMPW/jenkins.io/subscribers","subscription_url":"https://api.github.com/repos/HRMPW/jenkins.io/subscription","commits_url":"https://api.github.com/repos/HRMPW/jenkins.io/commits{/sha}","git_commits_url":"https://api.github.com/repos/HRMPW/jenkins.io/git/commits{/sha}","comments_url":"https://api.github.com/repos/HRMPW/jenkins.io/comments{/number}","issue_comment_url":"https://api.github.com/repos/HRMPW/jenkins.io/issues/comments{/number}","contents_url":"https://api.github.com/repos/HRMPW/jenkins.io/contents/{+path}","compare_url":"https://api.github.com/repos/HRMPW/jenkins.io/compare/{base}...{head}","merges_url":"https://api.github.com/repos/HRMPW/jenkins.io/merges","archive_url":"https://api.github.com/repos/HRMPW/jenkins.io/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/HRMPW/jenkins.io/downloads","issues_url":"https://api.github.com/repos/HRMPW/jenkins.io/issues{/number}","pulls_url":"https://api.github.com/repos/HRMPW/jenkins.io/pulls{/number}","milestones_url":"https://api.github.com/repos/HRMPW/jenkins.io/milestones{/number}","notifications_url":"https://api.github.com/repos/HRMPW/jenkins.io/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/HRMPW/jenkins.io/labels{/name}","releases_url":"https://api.github.com/repos/HRMPW/jenkins.io/releases{/id}","deployments_url":"https://api.github.com/repos/HRMPW/jenkins.io/deployments","created_at":"2016-10-12T00:16:41Z","updated_at":"2016-10-12T00:16:44Z","pushed_at":"2016-12-16T19:39:34Z","git_url":"git://github.com/HRMPW/jenkins.io.git","ssh_url":"git@github.com:HRMPW/jenkins.io.git","clone_url":"https://github.com/HRMPW/jenkins.io.git","svn_url":"https://github.com/HRMPW/jenkins.io","homepage":"https://jenkins.io","size":110409,"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":"5326280648b36ed71623b4350b93252cf560ec7a","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-12-16T19:00:23Z","pushed_at":"2016-12-16T19:39: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.io","size":110399,"stargazers_count":41,"watchers_count":41,"language":"HTML","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":123,"mirror_url":null,"open_issues_count":7,"forks":123,"open_issues":7,"watchers":41,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/504"},"html":{"href":"https://github.com/jenkins-infra/jenkins.io/pull/504"},"issue":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/504"},"comments":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/issues/504/comments"},"review_comments":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/pulls/504/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/504/commits"},"statuses":{"href":"https://api.github.com/repos/jenkins-infra/jenkins.io/statuses/e17bb8dc2396275e11fdeb876fb2d77058e6a8eb"}}}}
{"actor":{"display_login":"bitwiseman"}}