Skip to content

Commit

Permalink
add more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephan Krusche committed Jul 11, 2021
1 parent 0fb8b3c commit 05942fe
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>de.tum.in.www1</groupId>
<artifactId>bamboo-server</artifactId>
<version>1.3.5</version>
<version>1.3.6</version>
<organization>
<name>LS1 TUM</name>
<url>https://ase.in.tum.de</url>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,17 @@
import com.atlassian.bamboo.v2.build.CurrentBuildResult;
import com.atlassian.bamboo.v2.build.events.PostBuildCompletedEvent;
import com.atlassian.event.api.EventListener;
import org.apache.log4j.Logger;

import java.util.Collections;

public class BuildCompleteListener {

private static final Logger log = Logger.getLogger(BuildCompleteListener.class);

@EventListener
public void onPostBuildComplete(final PostBuildCompletedEvent postBuildCompletedEvent) {
log.info("[BAMBOO-SERVER-NOTIFICATION] onPostBuildComplete: " + postBuildCompletedEvent.getPlanResultKey().toString());
CurrentBuildResult currentBuildResult = postBuildCompletedEvent.getContext().getBuildResult();
ResultsContainer resultsContainer = new ResultsContainer(postBuildCompletedEvent.getPlanResultKey(),
currentBuildResult.getSuccessfulTestResults() != null ? currentBuildResult.getSuccessfulTestResults() : Collections.emptySet(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

public class ServerNotificationRecipient extends AbstractNotificationRecipient
implements DeploymentResultAwareNotificationRecipient, NotificationRecipient.RequiresPlan, NotificationRecipient.RequiresResultSummary

{

private static String WEBHOOK_URL = "webhookUrl";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ public ServerNotificationTransport(String webhookUrl,
}

public void sendNotification(@NotNull Notification notification) {
log.info("[BAMBOO-SERVER-NOTIFICATION] start send notification for plan: " + plan.getPlanKey());
logToBuildLog("Sending notification");
try {
HttpPost method = setupPostMethod();
Expand Down Expand Up @@ -197,6 +198,7 @@ public void sendNotification(@NotNull Notification notification) {
logErrorToBuildLog("Error parsing webhook url: " + e.getMessage());
log.error("Error parsing webhook url: " + e.getMessage(), e);
}
log.info("[BAMBOO-SERVER-NOTIFICATION] finish send notification for plan: " + plan.getPlanKey());
}

private HttpPost setupPostMethod() throws URISyntaxException {
Expand Down

0 comments on commit 05942fe

Please sign in to comment.