| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package App::CISetup::AppVeyor::ConfigFile; |
|
2
|
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
330628
|
use strict; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
30
|
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
24
|
|
|
5
|
1
|
|
|
1
|
|
7
|
use namespace::autoclean; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
15
|
|
|
6
|
1
|
|
|
1
|
|
691
|
use autodie qw( :all ); |
|
|
1
|
|
|
|
|
14130
|
|
|
|
1
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.19'; |
|
9
|
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
22610
|
use App::CISetup::Types qw( Str ); |
|
|
1
|
|
|
|
|
5
|
|
|
|
1
|
|
|
|
|
8
|
|
|
11
|
|
|
|
|
|
|
|
|
12
|
1
|
|
|
1
|
|
5123
|
use Moose; |
|
|
1
|
|
|
|
|
3
|
|
|
|
1
|
|
|
|
|
11
|
|
|
13
|
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has email_address => ( |
|
15
|
|
|
|
|
|
|
is => 'ro', |
|
16
|
|
|
|
|
|
|
isa => Str, # todo, better type |
|
17
|
|
|
|
|
|
|
predicate => 'has_email_address', |
|
18
|
|
|
|
|
|
|
); |
|
19
|
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
has slack_channel => ( |
|
21
|
|
|
|
|
|
|
is => 'ro', |
|
22
|
|
|
|
|
|
|
isa => Str, |
|
23
|
|
|
|
|
|
|
predicate => 'has_slack_channel', |
|
24
|
|
|
|
|
|
|
); |
|
25
|
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
has encrypted_slack_key => ( |
|
27
|
|
|
|
|
|
|
is => 'ro', |
|
28
|
|
|
|
|
|
|
isa => Str, |
|
29
|
|
|
|
|
|
|
predicate => 'has_encrypted_slack_key', |
|
30
|
|
|
|
|
|
|
); |
|
31
|
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
with 'App::CISetup::Role::ConfigFile'; |
|
33
|
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
## no critic (Subroutines::ProhibitUnusedPrivateSubroutines) |
|
35
|
|
|
|
|
|
|
sub _create_config { |
|
36
|
1
|
|
|
1
|
|
4
|
my $self = shift; |
|
37
|
|
|
|
|
|
|
|
|
38
|
1
|
|
|
|
|
15
|
return $self->_update_config( |
|
39
|
|
|
|
|
|
|
{ |
|
40
|
|
|
|
|
|
|
skip_tags => 'true', |
|
41
|
|
|
|
|
|
|
cache => ['C:\strawberry'], |
|
42
|
|
|
|
|
|
|
install => [ |
|
43
|
|
|
|
|
|
|
'if not exist "C:\strawberry" cinst strawberryperl -y', |
|
44
|
|
|
|
|
|
|
'set PATH=C:\strawberry\perl\bin;C:\strawberry\perl\site\bin;C:\strawberry\c\bin;%PATH%', |
|
45
|
|
|
|
|
|
|
'cd %APPVEYOR_BUILD_FOLDER%', |
|
46
|
|
|
|
|
|
|
'cpanm --installdeps . -n', |
|
47
|
|
|
|
|
|
|
], |
|
48
|
|
|
|
|
|
|
build_script => ['perl -e 1'], |
|
49
|
|
|
|
|
|
|
test_script => ['prove -lrvm t/'], |
|
50
|
|
|
|
|
|
|
} |
|
51
|
|
|
|
|
|
|
); |
|
52
|
|
|
|
|
|
|
} |
|
53
|
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _update_config { |
|
55
|
4
|
|
|
4
|
|
12
|
my $self = shift; |
|
56
|
4
|
|
|
|
|
11
|
my $appveyor = shift; |
|
57
|
|
|
|
|
|
|
|
|
58
|
4
|
|
|
|
|
24
|
$self->_update_notifications($appveyor); |
|
59
|
|
|
|
|
|
|
|
|
60
|
4
|
|
|
|
|
27
|
return $appveyor; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
## use critic |
|
63
|
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub _update_notifications { |
|
65
|
4
|
|
|
4
|
|
10
|
my $self = shift; |
|
66
|
4
|
|
|
|
|
11
|
my $appveyor = shift; |
|
67
|
|
|
|
|
|
|
|
|
68
|
4
|
|
|
|
|
33
|
my @notifications; |
|
69
|
4
|
50
|
33
|
|
|
217
|
push @notifications, { |
|
70
|
|
|
|
|
|
|
provider => 'Slack', |
|
71
|
|
|
|
|
|
|
auth_token => { |
|
72
|
|
|
|
|
|
|
secure => $self->encrypted_slack_key, |
|
73
|
|
|
|
|
|
|
}, |
|
74
|
|
|
|
|
|
|
channel => $self->slack_channel, |
|
75
|
|
|
|
|
|
|
on_build_failure => 'true', |
|
76
|
|
|
|
|
|
|
on_build_status_changed => 'true', |
|
77
|
|
|
|
|
|
|
on_build_success => 'true', |
|
78
|
|
|
|
|
|
|
} if $self->has_encrypted_slack_key && $self->has_slack_channel; |
|
79
|
|
|
|
|
|
|
|
|
80
|
4
|
50
|
|
|
|
152
|
push @notifications, { |
|
81
|
|
|
|
|
|
|
provider => 'Email', |
|
82
|
|
|
|
|
|
|
subject => 'AppVeyor build {{status}}', |
|
83
|
|
|
|
|
|
|
to => [ $self->email_address ], |
|
84
|
|
|
|
|
|
|
on_build_failure => 'true', |
|
85
|
|
|
|
|
|
|
on_build_status_changed => 'true', |
|
86
|
|
|
|
|
|
|
on_build_success => 'false', |
|
87
|
|
|
|
|
|
|
} if $self->has_email_address; |
|
88
|
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
$appveyor->{notifications} = \@notifications |
|
90
|
4
|
50
|
|
|
|
22
|
if @notifications; |
|
91
|
|
|
|
|
|
|
|
|
92
|
4
|
|
|
|
|
17
|
return; |
|
93
|
|
|
|
|
|
|
} |
|
94
|
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
my @BlocksOrder = qw( |
|
96
|
|
|
|
|
|
|
version |
|
97
|
|
|
|
|
|
|
skip_tags |
|
98
|
|
|
|
|
|
|
init |
|
99
|
|
|
|
|
|
|
environment |
|
100
|
|
|
|
|
|
|
matrix |
|
101
|
|
|
|
|
|
|
cache |
|
102
|
|
|
|
|
|
|
services |
|
103
|
|
|
|
|
|
|
install |
|
104
|
|
|
|
|
|
|
before_build |
|
105
|
|
|
|
|
|
|
build_script |
|
106
|
|
|
|
|
|
|
after_build |
|
107
|
|
|
|
|
|
|
before_test |
|
108
|
|
|
|
|
|
|
test_script |
|
109
|
|
|
|
|
|
|
after_test |
|
110
|
|
|
|
|
|
|
artifacts |
|
111
|
|
|
|
|
|
|
on_success |
|
112
|
|
|
|
|
|
|
on_failure |
|
113
|
|
|
|
|
|
|
on_finish |
|
114
|
|
|
|
|
|
|
notifications |
|
115
|
|
|
|
|
|
|
); |
|
116
|
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
## no critic (Subroutines::ProhibitUnusedPrivateSubroutines) |
|
118
|
|
|
|
|
|
|
sub _fix_up_yaml { |
|
119
|
8
|
|
|
8
|
|
18
|
my $self = shift; |
|
120
|
8
|
|
|
|
|
14
|
my $yaml = shift; |
|
121
|
|
|
|
|
|
|
|
|
122
|
8
|
|
|
|
|
34
|
$yaml = $self->_reorder_yaml_blocks( $yaml, \@BlocksOrder ); |
|
123
|
|
|
|
|
|
|
|
|
124
|
8
|
|
|
|
|
39
|
return $yaml; |
|
125
|
|
|
|
|
|
|
} |
|
126
|
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
sub _cisetup_flags { |
|
128
|
4
|
|
|
4
|
|
10
|
my $self = shift; |
|
129
|
|
|
|
|
|
|
|
|
130
|
4
|
|
|
|
|
10
|
my %flags; |
|
131
|
4
|
50
|
|
|
|
204
|
$flags{email_address} = $self->email_address |
|
132
|
|
|
|
|
|
|
if $self->has_email_address; |
|
133
|
|
|
|
|
|
|
|
|
134
|
4
|
50
|
|
|
|
188
|
$flags{slack_channel} = $self->slack_channel |
|
135
|
|
|
|
|
|
|
if $self->has_slack_channel; |
|
136
|
|
|
|
|
|
|
|
|
137
|
4
|
|
|
|
|
23
|
return \%flags; |
|
138
|
|
|
|
|
|
|
} |
|
139
|
|
|
|
|
|
|
## use critic |
|
140
|
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
1; |