Commit c7648df9859c7a5dca52897d7ff27fd35492a12c
1 parent
ae7d8cda
Exists in
master
move hardcoded urls to config file
Showing
2 changed files
with
13 additions
and
11 deletions
Show diff stats
config.yaml
lib/CoprStatus.pm
@@ -41,11 +41,11 @@ sub download_specs { | @@ -41,11 +41,11 @@ sub download_specs { | ||
41 | my $dec_result = $json->decode($result); | 41 | my $dec_result = $json->decode($result); |
42 | foreach(@{$dec_result->{'packages'}}) { | 42 | foreach(@{$dec_result->{'packages'}}) { |
43 | my $package = $_->{'pkg_name'}; | 43 | my $package = $_->{'pkg_name'}; |
44 | - my $git_url = git_url('http://softwarepublico.gov.br', | ||
45 | - 'gitlab/softwarepublico/softwarepublico/raw/<branch>/src/pkg-rpm/<package>/<package>.spec', | 44 | + my $git_url = git_url($config->{GitDomain}, |
45 | + $config->{GitSpecPath}, | ||
46 | $branch, $package); | 46 | $branch, $package); |
47 | `mkdir -p data/git/$branch`; | 47 | `mkdir -p data/git/$branch`; |
48 | - my $spec_filename = 'data/git/'.$branch.'/'.$package.'.spec'; | 48 | + my $spec_filename = "data/git/$branch/$package.spec"; |
49 | $ua->mirror( $git_url, $spec_filename ); | 49 | $ua->mirror( $git_url, $spec_filename ); |
50 | } | 50 | } |
51 | } | 51 | } |
@@ -138,28 +138,28 @@ sub info2html { | @@ -138,28 +138,28 @@ sub info2html { | ||
138 | update_info(); | 138 | update_info(); |
139 | my $table_entries=""; | 139 | my $table_entries=""; |
140 | foreach my $package (keys %{$info}) { | 140 | foreach my $package (keys %{$info}) { |
141 | - my $fill_v4_row; | ||
142 | - my $fill_v5_row; | 141 | + my $fill_stable_row; |
142 | + my $fill_dev_row; | ||
143 | if($info->{$package}->{'copr'}->{${$config->{Repositories}}[0]} eq $info->{$package}->{'git'}->{${$config->{Branches}}[0]}) { | 143 | if($info->{$package}->{'copr'}->{${$config->{Repositories}}[0]} eq $info->{$package}->{'git'}->{${$config->{Branches}}[0]}) { |
144 | - $fill_v4_row = "success"; | 144 | + $fill_stable_row = "success"; |
145 | } | 145 | } |
146 | else { | 146 | else { |
147 | - $fill_v4_row = "danger"; | 147 | + $fill_stable_row = "danger"; |
148 | } | 148 | } |
149 | 149 | ||
150 | if($info->{$package}->{'copr'}->{${$config->{Repositories}}[1]} eq $info->{$package}->{'git'}->{${$config->{Branches}}[1]}) { | 150 | if($info->{$package}->{'copr'}->{${$config->{Repositories}}[1]} eq $info->{$package}->{'git'}->{${$config->{Branches}}[1]}) { |
151 | - $fill_v5_row = "success"; | 151 | + $fill_dev_row = "success"; |
152 | } | 152 | } |
153 | else { | 153 | else { |
154 | - $fill_v5_row = "danger"; | 154 | + $fill_dev_row = "danger"; |
155 | } | 155 | } |
156 | 156 | ||
157 | $table_entries .= "<tr> | 157 | $table_entries .= "<tr> |
158 | <td><b>$package</b></td> | 158 | <td><b>$package</b></td> |
159 | <td>$info->{$package}->{'git'}->{${$config->{Branches}}[0]}</td> | 159 | <td>$info->{$package}->{'git'}->{${$config->{Branches}}[0]}</td> |
160 | - <td class=\"$fill_v4_row\">$info->{$package}->{'copr'}->{${$config->{Repositories}}[0]}</td> | 160 | + <td class=\"$fill_stable_row\">$info->{$package}->{'copr'}->{${$config->{Repositories}}[0]}</td> |
161 | <td>$info->{$package}->{'git'}->{${$config->{Branches}}[1]}</td> | 161 | <td>$info->{$package}->{'git'}->{${$config->{Branches}}[1]}</td> |
162 | - <td class=\"$fill_v5_row\">$info->{$package}->{'copr'}->{${$config->{Repositories}}[1]}</td> | 162 | + <td class=\"$fill_dev_row\">$info->{$package}->{'copr'}->{${$config->{Repositories}}[1]}</td> |
163 | </tr>"; | 163 | </tr>"; |
164 | } | 164 | } |
165 | 165 |