[TASK] bamboo sends nightly build messages to intercept 70/59170/2
authorChristian Kuhn <lolli@schwarzbu.ch>
Sun, 16 Dec 2018 14:46:54 +0000 (15:46 +0100)
committerAnja Leichsenring <aleichsenring@ab-softlab.de>
Sun, 16 Dec 2018 15:44:28 +0000 (16:44 +0100)
Resolves: #87171
Releases: master, 9.5, 8.7
Change-Id: Ia71eb5ce2824ff3c39dbc526ec3a3d93b4990eca
Reviewed-on: https://review.typo3.org/59170
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Build/bamboo/src/main/java/core/NightlySpec.java

index 10f3a0a..867a5ce 100644 (file)
@@ -16,14 +16,18 @@ package core;
 import java.util.ArrayList;
 
 import com.atlassian.bamboo.specs.api.BambooSpec;
+import com.atlassian.bamboo.specs.api.builders.AtlassianModule;
 import com.atlassian.bamboo.specs.api.builders.BambooKey;
 import com.atlassian.bamboo.specs.api.builders.Variable;
+import com.atlassian.bamboo.specs.api.builders.notification.AnyNotificationRecipient;
+import com.atlassian.bamboo.specs.api.builders.notification.Notification;
 import com.atlassian.bamboo.specs.api.builders.plan.Job;
 import com.atlassian.bamboo.specs.api.builders.plan.Plan;
 import com.atlassian.bamboo.specs.api.builders.plan.Stage;
 import com.atlassian.bamboo.specs.api.builders.plan.branches.BranchCleanup;
 import com.atlassian.bamboo.specs.api.builders.plan.branches.PlanBranchManagement;
 import com.atlassian.bamboo.specs.api.builders.project.Project;
+import com.atlassian.bamboo.specs.builders.notification.PlanCompletedNotification;
 import com.atlassian.bamboo.specs.builders.task.ScriptTask;
 import com.atlassian.bamboo.specs.builders.trigger.ScheduledTrigger;
 import com.atlassian.bamboo.specs.model.task.ScriptTaskProperties;
@@ -153,6 +157,12 @@ public class NightlySpec extends AbstractCoreSpec {
                 new PlanBranchManagement()
                     .delete(new BranchCleanup())
                     .notificationForCommitters()
+            )
+            .notifications(new Notification()
+                .type(new PlanCompletedNotification())
+                .recipients(new AnyNotificationRecipient(new AtlassianModule("com.atlassian.bamboo.plugins.bamboo-slack:recipient.slack"))
+                    .recipientString("https://intercept.typo3.com/bamboo")
+                )
             );
     }