{"action":"created","comment":{"url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/comments/65514443","id":65514443,"diff_hunk":"@@ -0,0 +1,112 @@\n+---\n+layout: post\n+title: \"How to empower your Jenkins with Gradle\"\n+date: \"2016-05-31 10:59:11\"\n+categories: tech-stories\n+authors: [\"Renato T.\"]\n+---\n+\n+Since the [last blog]( https://developer.epages.com/blog/2016/01/28/jenkins-job-dsl-plugin.html) post we did some updates in our Jenkins environments and today we are going to talk a bit about it.\n+We are using a [Gradle Jenkins plugin](https://github.com/ghale/gradle-jenkins-plugin/wiki) to control Jenkins installation.\n+\n+We already mention about the dsl, in the [Job DSL Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Job+DSL+Plugin)\n+\n+So you may ask why we changed it?\n+Well, the other plugin you need to create a seed job, and at ePages, we have quite complex structure with a few shell scripts.\n+Some of those shell scripts are shared on the company level, so before changing them, we want to make sure they work properly. (testing fase!)\n+\n+Another advantage of this gradle plugin is that is simple to deploy. For instance I didn't want to break our Team Jenkins installation, so I run a instance of Jenkins in a docker container and deploy my playground scripts to it.\n+\n+## How to setup the project\n+In your main Project you should use the [gradle-jenkins-plugin](https://github.com/ghale/gradle-jenkins-plugin/wiki).\n+\n+I created a sample snippet for writing this blog post:\n+{% highlight groovy %}\n+buildscript {\n+  repositories {\n+    maven { url \"https://plugins.gradle.org/m2/\" }\n+    maven { url 'http://repo.jenkins-ci.org/releases/' }\n+    mavenLocal()\n+  }\n+  dependencies {\n+    classpath \"com.terrafolio:gradle-jenkins-plugin:1.3.2\"\n+  }\n+}\n+\n+apply plugin: 'com.terrafolio.jenkins'\n+\n+jenkins {\n+\n+    servers {\n+        localhost_jenkins {\n+            url 'http://localhost:8080/' //change for your jenkins name\n+            secure true\n+            username 'admin' //change for your user name\n+            password 'admin' //change for your password\n+        }\n+    }\n+\n+    defaultServer servers.localhost_jenkins\n+\n+    dsl {\n+        job(\"SampleJob\") {\n+            displayName 'My sample job'\n+            description ''\n+            logRotator {\n+                numToKeep(10)\n+            }\n+        }\n+\n+    } // end dsl\n+}\n+{% endhighlight %}\n+\n+## How to use\n+\n+I was using on my local Jenkins. After doing the proper changes on the dsl (jenkins.gradle), I just need to trigger the task updateJenkinsItems.\n+\n+To use it, you should create a gradle project and copy the snippet.\n+On the project folder you could use:\n+\n+-----------------------\n+{% highlight bash %}\n+./gradlew tasks\n+{% endhighlight %}\n+\n+This will provide you the list of available tasks:\n+{% image blog/blog-gradlew_tasks.jpg %}\n+\n+-----------------------\n+{% highlight bash %}\n+./gradlew validateJenkinsItems\n+{% endhighlight %}\n+This will validate local changes with your Jenkins\n+\n+-----------------------\n+{% highlight bash %}\n+./gradlew updateJenkinsItems\n+{% endhighlight %}\n+This will update your Jenkins installation with the dsl defined at your jenkins.gradle\n+{% image blog/blog-gradlew_updateJenkinsItems.jpg %}\n+\n+\n+## Conclusions\n+This plugin is really powerful and there are many cases where you could use to empower your jobs/automation environment. I hope the blog post ilustrate the applications of this plugin.\n+If you want to know more about the other jobs, have a look at complete documentation on the [project wiki](https://github.com/ghale/gradle-jenkins-plugin/wiki).\n+\n+#### Advantages\n+- We have our Jenkins jobs under a source control system (git)","path":"_posts/2016/2016-05-31-gradle-jenkins-plugin.md","position":null,"original_position":98,"commit_id":"a58a0929abf14fadba61fd2a6a071cafc33168d6","original_commit_id":"319183adb8d7c2bd7e34fdba640a75517402af65","user":{"login":"BirgitBader","id":10460958,"avatar_url":"https://avatars.githubusercontent.com/u/10460958?v=3","gravatar_id":"","url":"https://api.github.com/users/BirgitBader","html_url":"https://github.com/BirgitBader","followers_url":"https://api.github.com/users/BirgitBader/followers","following_url":"https://api.github.com/users/BirgitBader/following{/other_user}","gists_url":"https://api.github.com/users/BirgitBader/gists{/gist_id}","starred_url":"https://api.github.com/users/BirgitBader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BirgitBader/subscriptions","organizations_url":"https://api.github.com/users/BirgitBader/orgs","repos_url":"https://api.github.com/users/BirgitBader/repos","events_url":"https://api.github.com/users/BirgitBader/events{/privacy}","received_events_url":"https://api.github.com/users/BirgitBader/received_events","type":"User","site_admin":false},"body":"add fullstop","created_at":"2016-06-02T10:07:54Z","updated_at":"2016-06-02T10:07:54Z","html_url":"https://github.com/ePages-de/epages-docs/pull/532#discussion_r65514443","pull_request_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/532","_links":{"self":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/comments/65514443"},"html":{"href":"https://github.com/ePages-de/epages-docs/pull/532#discussion_r65514443"},"pull_request":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/532"}}},"pull_request":{"url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/532","id":72040934,"html_url":"https://github.com/ePages-de/epages-docs/pull/532","diff_url":"https://github.com/ePages-de/epages-docs/pull/532.diff","patch_url":"https://github.com/ePages-de/epages-docs/pull/532.patch","issue_url":"https://api.github.com/repos/ePages-de/epages-docs/issues/532","number":532,"state":"open","locked":false,"title":"Gradle jenkins plugin","user":{"login":"rteixeiraep","id":8351041,"avatar_url":"https://avatars.githubusercontent.com/u/8351041?v=3","gravatar_id":"","url":"https://api.github.com/users/rteixeiraep","html_url":"https://github.com/rteixeiraep","followers_url":"https://api.github.com/users/rteixeiraep/followers","following_url":"https://api.github.com/users/rteixeiraep/following{/other_user}","gists_url":"https://api.github.com/users/rteixeiraep/gists{/gist_id}","starred_url":"https://api.github.com/users/rteixeiraep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rteixeiraep/subscriptions","organizations_url":"https://api.github.com/users/rteixeiraep/orgs","repos_url":"https://api.github.com/users/rteixeiraep/repos","events_url":"https://api.github.com/users/rteixeiraep/events{/privacy}","received_events_url":"https://api.github.com/users/rteixeiraep/received_events","type":"User","site_admin":false},"body":"I`m going to rebase it tomorrow... but maybe you could have a look already :)","created_at":"2016-05-31T15:55:35Z","updated_at":"2016-06-02T10:07:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a220be0820a008ddbd7153f302a4667533a84e1f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/532/commits","review_comments_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/532/comments","review_comment_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ePages-de/epages-docs/issues/532/comments","statuses_url":"https://api.github.com/repos/ePages-de/epages-docs/statuses/a58a0929abf14fadba61fd2a6a071cafc33168d6","head":{"label":"rteixeiraep:gradle-jenkins-plugin","ref":"gradle-jenkins-plugin","sha":"a58a0929abf14fadba61fd2a6a071cafc33168d6","user":{"login":"rteixeiraep","id":8351041,"avatar_url":"https://avatars.githubusercontent.com/u/8351041?v=3","gravatar_id":"","url":"https://api.github.com/users/rteixeiraep","html_url":"https://github.com/rteixeiraep","followers_url":"https://api.github.com/users/rteixeiraep/followers","following_url":"https://api.github.com/users/rteixeiraep/following{/other_user}","gists_url":"https://api.github.com/users/rteixeiraep/gists{/gist_id}","starred_url":"https://api.github.com/users/rteixeiraep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rteixeiraep/subscriptions","organizations_url":"https://api.github.com/users/rteixeiraep/orgs","repos_url":"https://api.github.com/users/rteixeiraep/repos","events_url":"https://api.github.com/users/rteixeiraep/events{/privacy}","received_events_url":"https://api.github.com/users/rteixeiraep/received_events","type":"User","site_admin":false},"repo":{"id":60089930,"name":"epages-docs","full_name":"rteixeiraep/epages-docs","owner":{"login":"rteixeiraep","id":8351041,"avatar_url":"https://avatars.githubusercontent.com/u/8351041?v=3","gravatar_id":"","url":"https://api.github.com/users/rteixeiraep","html_url":"https://github.com/rteixeiraep","followers_url":"https://api.github.com/users/rteixeiraep/followers","following_url":"https://api.github.com/users/rteixeiraep/following{/other_user}","gists_url":"https://api.github.com/users/rteixeiraep/gists{/gist_id}","starred_url":"https://api.github.com/users/rteixeiraep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rteixeiraep/subscriptions","organizations_url":"https://api.github.com/users/rteixeiraep/orgs","repos_url":"https://api.github.com/users/rteixeiraep/repos","events_url":"https://api.github.com/users/rteixeiraep/events{/privacy}","received_events_url":"https://api.github.com/users/rteixeiraep/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rteixeiraep/epages-docs","description":"Source of ePages Developer Portal","fork":true,"url":"https://api.github.com/repos/rteixeiraep/epages-docs","forks_url":"https://api.github.com/repos/rteixeiraep/epages-docs/forks","keys_url":"https://api.github.com/repos/rteixeiraep/epages-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rteixeiraep/epages-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rteixeiraep/epages-docs/teams","hooks_url":"https://api.github.com/repos/rteixeiraep/epages-docs/hooks","issue_events_url":"https://api.github.com/repos/rteixeiraep/epages-docs/issues/events{/number}","events_url":"https://api.github.com/repos/rteixeiraep/epages-docs/events","assignees_url":"https://api.github.com/repos/rteixeiraep/epages-docs/assignees{/user}","branches_url":"https://api.github.com/repos/rteixeiraep/epages-docs/branches{/branch}","tags_url":"https://api.github.com/repos/rteixeiraep/epages-docs/tags","blobs_url":"https://api.github.com/repos/rteixeiraep/epages-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rteixeiraep/epages-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rteixeiraep/epages-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/rteixeiraep/epages-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rteixeiraep/epages-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/rteixeiraep/epages-docs/languages","stargazers_url":"https://api.github.com/repos/rteixeiraep/epages-docs/stargazers","contributors_url":"https://api.github.com/repos/rteixeiraep/epages-docs/contributors","subscribers_url":"https://api.github.com/repos/rteixeiraep/epages-docs/subscribers","subscription_url":"https://api.github.com/repos/rteixeiraep/epages-docs/subscription","commits_url":"https://api.github.com/repos/rteixeiraep/epages-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/rteixeiraep/epages-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/rteixeiraep/epages-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/rteixeiraep/epages-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/rteixeiraep/epages-docs/contents/{+path}","compare_url":"https://api.github.com/repos/rteixeiraep/epages-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rteixeiraep/epages-docs/merges","archive_url":"https://api.github.com/repos/rteixeiraep/epages-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rteixeiraep/epages-docs/downloads","issues_url":"https://api.github.com/repos/rteixeiraep/epages-docs/issues{/number}","pulls_url":"https://api.github.com/repos/rteixeiraep/epages-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/rteixeiraep/epages-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/rteixeiraep/epages-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rteixeiraep/epages-docs/labels{/name}","releases_url":"https://api.github.com/repos/rteixeiraep/epages-docs/releases{/id}","deployments_url":"https://api.github.com/repos/rteixeiraep/epages-docs/deployments","created_at":"2016-05-31T13:04:16Z","updated_at":"2016-05-31T13:04:18Z","pushed_at":"2016-06-02T08:27:47Z","git_url":"git://github.com/rteixeiraep/epages-docs.git","ssh_url":"git@github.com:rteixeiraep/epages-docs.git","clone_url":"https://github.com/rteixeiraep/epages-docs.git","svn_url":"https://github.com/rteixeiraep/epages-docs","homepage":"https://developer.epages.com/","size":169870,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","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":"develop"}},"base":{"label":"ePages-de:master","ref":"master","sha":"6ce4e624817ec062140ceaf548e9e696d9bee370","user":{"login":"ePages-de","id":1125854,"avatar_url":"https://avatars.githubusercontent.com/u/1125854?v=3","gravatar_id":"","url":"https://api.github.com/users/ePages-de","html_url":"https://github.com/ePages-de","followers_url":"https://api.github.com/users/ePages-de/followers","following_url":"https://api.github.com/users/ePages-de/following{/other_user}","gists_url":"https://api.github.com/users/ePages-de/gists{/gist_id}","starred_url":"https://api.github.com/users/ePages-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ePages-de/subscriptions","organizations_url":"https://api.github.com/users/ePages-de/orgs","repos_url":"https://api.github.com/users/ePages-de/repos","events_url":"https://api.github.com/users/ePages-de/events{/privacy}","received_events_url":"https://api.github.com/users/ePages-de/received_events","type":"Organization","site_admin":false},"repo":{"id":30595510,"name":"epages-docs","full_name":"ePages-de/epages-docs","owner":{"login":"ePages-de","id":1125854,"avatar_url":"https://avatars.githubusercontent.com/u/1125854?v=3","gravatar_id":"","url":"https://api.github.com/users/ePages-de","html_url":"https://github.com/ePages-de","followers_url":"https://api.github.com/users/ePages-de/followers","following_url":"https://api.github.com/users/ePages-de/following{/other_user}","gists_url":"https://api.github.com/users/ePages-de/gists{/gist_id}","starred_url":"https://api.github.com/users/ePages-de/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ePages-de/subscriptions","organizations_url":"https://api.github.com/users/ePages-de/orgs","repos_url":"https://api.github.com/users/ePages-de/repos","events_url":"https://api.github.com/users/ePages-de/events{/privacy}","received_events_url":"https://api.github.com/users/ePages-de/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ePages-de/epages-docs","description":"Source of ePages Developer Portal","fork":false,"url":"https://api.github.com/repos/ePages-de/epages-docs","forks_url":"https://api.github.com/repos/ePages-de/epages-docs/forks","keys_url":"https://api.github.com/repos/ePages-de/epages-docs/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ePages-de/epages-docs/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ePages-de/epages-docs/teams","hooks_url":"https://api.github.com/repos/ePages-de/epages-docs/hooks","issue_events_url":"https://api.github.com/repos/ePages-de/epages-docs/issues/events{/number}","events_url":"https://api.github.com/repos/ePages-de/epages-docs/events","assignees_url":"https://api.github.com/repos/ePages-de/epages-docs/assignees{/user}","branches_url":"https://api.github.com/repos/ePages-de/epages-docs/branches{/branch}","tags_url":"https://api.github.com/repos/ePages-de/epages-docs/tags","blobs_url":"https://api.github.com/repos/ePages-de/epages-docs/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ePages-de/epages-docs/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ePages-de/epages-docs/git/refs{/sha}","trees_url":"https://api.github.com/repos/ePages-de/epages-docs/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ePages-de/epages-docs/statuses/{sha}","languages_url":"https://api.github.com/repos/ePages-de/epages-docs/languages","stargazers_url":"https://api.github.com/repos/ePages-de/epages-docs/stargazers","contributors_url":"https://api.github.com/repos/ePages-de/epages-docs/contributors","subscribers_url":"https://api.github.com/repos/ePages-de/epages-docs/subscribers","subscription_url":"https://api.github.com/repos/ePages-de/epages-docs/subscription","commits_url":"https://api.github.com/repos/ePages-de/epages-docs/commits{/sha}","git_commits_url":"https://api.github.com/repos/ePages-de/epages-docs/git/commits{/sha}","comments_url":"https://api.github.com/repos/ePages-de/epages-docs/comments{/number}","issue_comment_url":"https://api.github.com/repos/ePages-de/epages-docs/issues/comments{/number}","contents_url":"https://api.github.com/repos/ePages-de/epages-docs/contents/{+path}","compare_url":"https://api.github.com/repos/ePages-de/epages-docs/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ePages-de/epages-docs/merges","archive_url":"https://api.github.com/repos/ePages-de/epages-docs/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ePages-de/epages-docs/downloads","issues_url":"https://api.github.com/repos/ePages-de/epages-docs/issues{/number}","pulls_url":"https://api.github.com/repos/ePages-de/epages-docs/pulls{/number}","milestones_url":"https://api.github.com/repos/ePages-de/epages-docs/milestones{/number}","notifications_url":"https://api.github.com/repos/ePages-de/epages-docs/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ePages-de/epages-docs/labels{/name}","releases_url":"https://api.github.com/repos/ePages-de/epages-docs/releases{/id}","deployments_url":"https://api.github.com/repos/ePages-de/epages-docs/deployments","created_at":"2015-02-10T14:20:56Z","updated_at":"2016-04-05T22:58:18Z","pushed_at":"2016-06-02T09:35:40Z","git_url":"git://github.com/ePages-de/epages-docs.git","ssh_url":"git@github.com:ePages-de/epages-docs.git","clone_url":"https://github.com/ePages-de/epages-docs.git","svn_url":"https://github.com/ePages-de/epages-docs","homepage":"https://developer.epages.com/","size":199468,"stargazers_count":7,"watchers_count":7,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":4,"forks":39,"open_issues":4,"watchers":7,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/532"},"html":{"href":"https://github.com/ePages-de/epages-docs/pull/532"},"issue":{"href":"https://api.github.com/repos/ePages-de/epages-docs/issues/532"},"comments":{"href":"https://api.github.com/repos/ePages-de/epages-docs/issues/532/comments"},"review_comments":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/532/comments"},"review_comment":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ePages-de/epages-docs/pulls/532/commits"},"statuses":{"href":"https://api.github.com/repos/ePages-de/epages-docs/statuses/a58a0929abf14fadba61fd2a6a071cafc33168d6"}}}}
{"actor":{"display_login":"BirgitBader"}}