forked from lix-project/hydra
CircleCiNotification: $b -> $build (perlcritic)
This commit is contained in:
parent
b6714cdce3
commit
0f88014631
|
@ -13,22 +13,22 @@ sub isEnabled {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub buildFinished {
|
sub buildFinished {
|
||||||
my ($self, $build, $dependents) = @_;
|
my ($self, $topbuild, $dependents) = @_;
|
||||||
my $cfg = $self->{config}->{circleci};
|
my $cfg = $self->{config}->{circleci};
|
||||||
my @config = defined $cfg ? ref $cfg eq "ARRAY" ? @$cfg : ($cfg) : ();
|
my @config = defined $cfg ? ref $cfg eq "ARRAY" ? @$cfg : ($cfg) : ();
|
||||||
|
|
||||||
# Figure out to which branches to send notification.
|
# Figure out to which branches to send notification.
|
||||||
my %branches;
|
my %branches;
|
||||||
foreach my $b ($build, @{$dependents}) {
|
foreach my $build ($topbuild, @{$dependents}) {
|
||||||
my $prevBuild = getPreviousBuild($b);
|
my $prevBuild = getPreviousBuild($build);
|
||||||
my $jobName = showJobName $b;
|
my $jobName = showJobName $build;
|
||||||
|
|
||||||
foreach my $branch (@config) {
|
foreach my $branch (@config) {
|
||||||
my $force = $branch->{force};
|
my $force = $branch->{force};
|
||||||
next unless $jobName =~ /^$branch->{jobs}$/;
|
next unless $jobName =~ /^$branch->{jobs}$/;
|
||||||
|
|
||||||
# If build is failed, don't trigger circleci
|
# If build is failed, don't trigger circleci
|
||||||
next if ! $force && $b->buildstatus != 0;
|
next if ! $force && $build->buildstatus != 0;
|
||||||
|
|
||||||
my $fullUrl = "https://circleci.com/api/v1.1/project/" . $branch->{vcstype} . "/" . $branch->{username} . "/" . $branch->{project} . "/tree/" . $branch->{branch} . "?circle-token=" . $branch->{token};
|
my $fullUrl = "https://circleci.com/api/v1.1/project/" . $branch->{vcstype} . "/" . $branch->{username} . "/" . $branch->{project} . "/tree/" . $branch->{branch} . "?circle-token=" . $branch->{token};
|
||||||
$branches{$fullUrl} = 1;
|
$branches{$fullUrl} = 1;
|
||||||
|
|
Loading…
Reference in a new issue