forked from lix-project/hydra
GitlabStatus: $build -> $topbuild, $b -> $build (perlcritic)
This commit is contained in:
parent
b4a19fd3c8
commit
bcf37ab705
|
@ -37,25 +37,25 @@ sub toGitlabState {
|
||||||
}
|
}
|
||||||
|
|
||||||
sub common {
|
sub common {
|
||||||
my ($self, $build, $dependents, $status) = @_;
|
my ($self, $topbuild, $dependents, $status) = @_;
|
||||||
my $baseurl = $self->{config}->{'base_uri'} || "http://localhost:3000";
|
my $baseurl = $self->{config}->{'base_uri'} || "http://localhost:3000";
|
||||||
|
|
||||||
# Find matching configs
|
# Find matching configs
|
||||||
foreach my $b ($build, @{$dependents}) {
|
foreach my $build ($topbuild, @{$dependents}) {
|
||||||
my $jobName = showJobName $b;
|
my $jobName = showJobName $build;
|
||||||
my $evals = $build->jobsetevals;
|
my $evals = $topbuild->jobsetevals;
|
||||||
my $ua = LWP::UserAgent->new();
|
my $ua = LWP::UserAgent->new();
|
||||||
|
|
||||||
# Don't send out "pending/running" status updates if the build is already finished
|
# Don't send out "pending/running" status updates if the build is already finished
|
||||||
next if $status < 2 && $b->finished == 1;
|
next if $status < 2 && $build->finished == 1;
|
||||||
|
|
||||||
my $state = toGitlabState($status, $b->buildstatus);
|
my $state = toGitlabState($status, $build->buildstatus);
|
||||||
my $body = encode_json(
|
my $body = encode_json(
|
||||||
{
|
{
|
||||||
state => $state,
|
state => $state,
|
||||||
target_url => "$baseurl/build/" . $b->id,
|
target_url => "$baseurl/build/" . $build->id,
|
||||||
description => "Hydra build #" . $b->id . " of $jobName",
|
description => "Hydra build #" . $build->id . " of $jobName",
|
||||||
name => "Hydra " . $b->get_column('job'),
|
name => "Hydra " . $build->get_column('job'),
|
||||||
});
|
});
|
||||||
while (my $eval = $evals->next) {
|
while (my $eval = $evals->next) {
|
||||||
my $gitlabstatusInput = $eval->jobsetevalinputs->find({ name => "gitlab_status_repo" });
|
my $gitlabstatusInput = $eval->jobsetevalinputs->find({ name => "gitlab_status_repo" });
|
||||||
|
|
Loading…
Reference in a new issue