You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2015/05/21 12:45:05 UTC

incubator-ignite git commit: # ignite-456: addJiraComment with a builds info

Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-456 c91674e84 -> 68123e618


# ignite-456: addJiraComment with a builds info


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/68123e61
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/68123e61
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/68123e61

Branch: refs/heads/ignite-456
Commit: 68123e61811f76023d6191dfc92793ad9b229836
Parents: c91674e
Author: null <null>
Authored: Thu May 21 13:46:05 2015 +0300
Committer: null <null>
Committed: Thu May 21 13:46:05 2015 +0300

----------------------------------------------------------------------
 dev-tools/src/main/groovy/jiraslurp.groovy | 58 +++++++++++++++----------
 1 file changed, 35 insertions(+), 23 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/68123e61/dev-tools/src/main/groovy/jiraslurp.groovy
----------------------------------------------------------------------
diff --git a/dev-tools/src/main/groovy/jiraslurp.groovy b/dev-tools/src/main/groovy/jiraslurp.groovy
index 1add26e..dabc3ef 100644
--- a/dev-tools/src/main/groovy/jiraslurp.groovy
+++ b/dev-tools/src/main/groovy/jiraslurp.groovy
@@ -250,6 +250,32 @@ def sendPostRequest = { urlString, user, pwd, postData, contentType ->
 }
 
 /**
+ * Adds comment to jira ticket.
+ */
+def addJiraComment = { jiraNum, comment ->
+    def user = System.getenv('JIRA_USER')
+    def pwd = System.getenv('JIRA_PWD')
+
+    try {
+        println "Comment: $comment"
+
+        def jsonComment = "{\n \"body\": \"${comment}\"\n}";
+
+        def response = sendPostRequest(
+            "$JIRA_URL/jira/rest/api/2/issue/$jiraNum/comment" as String,
+            user,
+            pwd,
+            jsonComment,
+            "application/json")
+
+        println "Response: $response"
+    }
+    catch (Exception e) {
+        e.printStackTrace()
+    }
+}
+
+/**
  * Runs all given test builds to validate last patch from given jira.
  */
 def runAllTestBuilds = {builds, jiraNum ->
@@ -257,6 +283,8 @@ def runAllTestBuilds = {builds, jiraNum ->
     def user = System.getenv('TASK_RUNNER_USER')
     def pwd = System.getenv('TASK_RUNNER_PWD')
 
+    def triggeredBuilds = [:]
+
     builds.each {
         try {
             println "Triggering $it build for $jiraNum jira..."
@@ -293,37 +321,21 @@ def runAllTestBuilds = {builds, jiraNum ->
             println "Triggered build: ${build.buildType.@name}"
             println "Triggered build url: ${build.@webUrl}"
             println "Triggered build branch: ${build.@branchName}"
+
+            triggeredBuilds.put(build.buildType.@name, build.@webUrl)
         }
         catch (Exception e) {
             e.printStackTrace()
         }
     }
-}
-
-/**
- * Adds comment to jira ticket.
- */
-def addJiraComment = { jiraNum, comment ->
-    def user = System.getenv('JIRA_USER')
-    def pwd = System.getenv('JIRA_PWD')
-
-    try {
-        println "Comment: $comment"
 
-        def jsonComment = "{\n \"body\": \"${comment}\"\n}";
+    def triggeredBuildsComment = "There was triggered next test builds for last attached patch-file:\\n"
 
-        def response = sendPostRequest(
-            "$JIRA_URL/jira/rest/api/2/issue/$jiraNum/comment" as String,
-            user,
-            pwd,
-            jsonComment,
-            "application/json")
-
-        println "Response: $response"
-    }
-    catch (Exception e) {
-        e.printStackTrace()
+    triggeredBuilds.each { name, url ->
+        triggeredBuildsComment += "${name as String} - ${url as String}\\n"
     }
+
+    addJiraComment(jiraNum, triggeredBuildsComment)
 }
 
 /**