Add a basic Dockerfile and fix some minor issues in push.pl
This commit is contained in:
parent
9a13965512
commit
1a7ef62ffb
|
|
@ -0,0 +1,10 @@
|
||||||
|
FROM tianon/mojo
|
||||||
|
|
||||||
|
RUN cpanm Term::ReadKey
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y vim
|
||||||
|
|
||||||
|
COPY . /usr/src/docker-library-docs
|
||||||
|
WORKDIR /usr/src/docker-library-docs
|
||||||
|
|
||||||
|
CMD ["./push.pl"]
|
||||||
9
push.pl
9
push.pl
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/perl -w
|
#!/usr/bin/env perl
|
||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
|
use 5.010;
|
||||||
use open ':encoding(utf8)';
|
use open ':encoding(utf8)';
|
||||||
|
|
||||||
use File::Temp;
|
use File::Temp;
|
||||||
|
|
@ -163,7 +164,9 @@ while (my $repo = shift) { # '/_/hylang', '/u/tianon/perl', etc
|
||||||
$repoTx = $ua->post($repoUrl => { Referer => $repoUrl } => form => $settingsBits);
|
$repoTx = $ua->post($repoUrl => { Referer => $repoUrl } => form => $settingsBits);
|
||||||
die 'post to ' . $repoUrl . ' failed' unless $repoTx->success;
|
die 'post to ' . $repoUrl . ' failed' unless $repoTx->success;
|
||||||
|
|
||||||
if (my $alert = $repoTx->res->dom('.alert-error')) {
|
my $alert = $repoTx->res->dom('.alert-error');
|
||||||
die 'update to ' . $repoUrl . ' failed:' . "\n" . $alert->all_text;
|
if ($alert->size) {
|
||||||
|
my $text = trim $alert->pluck('all_text');
|
||||||
|
die 'update to ' . $repoUrl . ' failed:' . "\n" . $text if $text;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue