line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Jenkins::Notification; |
2
|
1
|
|
|
1
|
|
858
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
27
|
|
3
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
29
|
|
4
|
1
|
|
|
1
|
|
1499
|
use Moose; |
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
use Net::Jenkins::Utils qw(build_job_object build_build_object); |
6
|
|
|
|
|
|
|
use Net::Jenkins::Job; |
7
|
|
|
|
|
|
|
use Net::Jenkins::Job::Build; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
# job name |
10
|
|
|
|
|
|
|
has name => ( is => 'rw' , isa => 'Str' ); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# job url |
13
|
|
|
|
|
|
|
has url => ( is => 'rw', isa => 'Str' ); |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has build => ( is => 'rw' , isa => 'Net::Jenkins::Job::Build' ); |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has job => ( is => 'rw', isa => 'Net::Jenkins::Job' ); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
has status => ( is => 'rw' , isa => 'Str' , default => 'UNKNOWN' ); |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
has phase => ( is => 'rw' , isa => 'Str' ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has parameters => ( is => 'rw' ); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has api => ( is => 'rw', isa => 'Net::Jenkins' ); |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# raw json |
29
|
|
|
|
|
|
|
has raw_json => ( is => 'rw', isa => 'Str' ); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub BUILDARGS { |
32
|
|
|
|
|
|
|
my ($self,%args) = @_; |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
my $build_args = delete $args{build}; |
35
|
|
|
|
|
|
|
my $build_url = $build_args->{full_url}; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
$args{job} = build_job_object $build_url; |
38
|
|
|
|
|
|
|
$args{url} = $args{job}->url; |
39
|
|
|
|
|
|
|
$args{build} = build_build_object $build_url; |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
$args{status} = $build_args->{status} if $build_args->{status}; |
42
|
|
|
|
|
|
|
$args{phase} = $build_args->{phase} if $build_args->{phase}; |
43
|
|
|
|
|
|
|
$args{api} = $args{build}->api; |
44
|
|
|
|
|
|
|
return \%args; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
sub to_hashref { |
48
|
|
|
|
|
|
|
my ($self,$with_details) = @_; |
49
|
|
|
|
|
|
|
return { |
50
|
|
|
|
|
|
|
name => $self->name, |
51
|
|
|
|
|
|
|
url => $self->url, |
52
|
|
|
|
|
|
|
build => $self->build->to_hashref( $with_details ), |
53
|
|
|
|
|
|
|
job => $self->job->to_hashref( $with_details ), |
54
|
|
|
|
|
|
|
status => $self->status, |
55
|
|
|
|
|
|
|
phase => $self->phase, |
56
|
|
|
|
|
|
|
parameters => $self->parameters, |
57
|
|
|
|
|
|
|
}; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
1; |
61
|
|
|
|
|
|
|
__END__ |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head1 NAME |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
Jenkins::Notification |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head1 ATTRIBUTES |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 name (Str) |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Job name |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head2 url (Str) |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
Job url |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head2 build |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
L<Net::Jenkins::Job::Build> object |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head2 job |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
L<Net::Jenkins::Job> object |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head2 status (Str) |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
Build Status |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head2 phase (Str) |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Build Phase |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 parameters (HashRef) |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
=head2 api |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
L<Net::Jenkins> object |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
=cut |