From 03be8ae7a138d32013c7c658b8491b314c77889a Mon Sep 17 00:00:00 2001 From: Casey Ransom Date: Tue, 1 Sep 2020 15:06:16 -0400 Subject: [PATCH] Remove image dependency on hydra.nixos.org Also standardize the slack image size on 256 pixels. --- src/lib/Hydra/Plugin/HipChatNotification.pm | 9 ++++----- src/lib/Hydra/Plugin/SlackNotification.pm | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/lib/Hydra/Plugin/HipChatNotification.pm b/src/lib/Hydra/Plugin/HipChatNotification.pm index e4d1b74f..eb592d05 100644 --- a/src/lib/Hydra/Plugin/HipChatNotification.pm +++ b/src/lib/Hydra/Plugin/HipChatNotification.pm @@ -50,12 +50,11 @@ sub buildFinished { my $room = $rooms{$roomId}; my @deps = grep { $_->id != $build->id } @{$room->{builds}}; - my $imgBase = "http://hydra.nixos.org"; my $img = - $build->buildstatus == 0 ? "$imgBase/static/images/checkmark_16.png" : - $build->buildstatus == 2 ? "$imgBase/static/images/dependency_16.png" : - $build->buildstatus == 4 ? "$imgBase/static/images/cancelled_16.png" : - "$imgBase/static/images/error_16.png"; + $build->buildstatus == 0 ? "$baseurl/static/images/checkmark_16.png" : + $build->buildstatus == 2 ? "$baseurl/static/images/dependency_16.png" : + $build->buildstatus == 4 ? "$baseurl/static/images/cancelled_16.png" : + "$baseurl/static/images/error_16.png"; my $msg = ""; $msg .= " "; diff --git a/src/lib/Hydra/Plugin/SlackNotification.pm b/src/lib/Hydra/Plugin/SlackNotification.pm index a09fbe03..e94e937b 100644 --- a/src/lib/Hydra/Plugin/SlackNotification.pm +++ b/src/lib/Hydra/Plugin/SlackNotification.pm @@ -127,12 +127,11 @@ sub buildFinished { my $channel = $channels{$url}; my @deps = grep { $_->id != $build->id } @{$channel->{builds}}; - my $imgBase = "http://hydra.nixos.org"; my $img = - $build->buildstatus == 0 ? "$imgBase/static/images/checkmark_256.png" : - $build->buildstatus == 2 ? "$imgBase/static/images/dependency_256.png" : - $build->buildstatus == 4 ? "$imgBase/static/images/cancelled_128.png" : - "$imgBase/static/images/error_256.png"; + $build->buildstatus == 0 ? "$baseurl/static/images/checkmark_256.png" : + $build->buildstatus == 2 ? "$baseurl/static/images/dependency_256.png" : + $build->buildstatus == 4 ? "$baseurl/static/images/cancelled_256.png" : + "$baseurl/static/images/error_256.png"; my $color = $build->buildstatus == 0 ? "good" :