Builds locally now, ready to run?
This commit is contained in:
parent
0f80db1f28
commit
dec88bfcc4
1 changed files with 9 additions and 7 deletions
16
generate.pl
16
generate.pl
|
@ -40,7 +40,7 @@ EOF
|
||||||
my $config = YAML::XS::Load path("config.yml")->slurp_utf8();
|
my $config = YAML::XS::Load path("config.yml")->slurp_utf8();
|
||||||
|
|
||||||
my $template = <<~'EOF';
|
my $template = <<~'EOF';
|
||||||
FROM {{base_image}}:{{tag}}
|
FROM {{build_image}}:{{tag}}
|
||||||
LABEL maintainer="Ryan Voots <simcop@cpan.org>"
|
LABEL maintainer="Ryan Voots <simcop@cpan.org>"
|
||||||
|
|
||||||
COPY *.patch /usr/src/perl/
|
COPY *.patch /usr/src/perl/
|
||||||
|
@ -77,9 +77,9 @@ my %builds;
|
||||||
|
|
||||||
# sha256 taken from http://www.cpan.org/authors/id/M/MI/MIYAGAWA/CHECKSUMS
|
# sha256 taken from http://www.cpan.org/authors/id/M/MI/MIYAGAWA/CHECKSUMS
|
||||||
my %cpanm = (
|
my %cpanm = (
|
||||||
name => "App-cpanminus-1.7044",
|
name => "App-cpanminus-1.7047",
|
||||||
url => "https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7047.tar.gz",
|
url => "https://cpan.metacpan.org/authors/id/M/MI/MIYAGAWA/App-cpanminus-1.7047.tar.gz",
|
||||||
sha256 => "9b60767fe40752ef7a9d3f13f19060a63389a5c23acc3e9827e19b75500f81f3", #TODO fix this value
|
sha256 => "963e63c6e1a8725ff2f624e9086396ae150db51dd0a337c3781d09a994af05a5",
|
||||||
);
|
);
|
||||||
|
|
||||||
die_with_sample unless defined $config->{releases};
|
die_with_sample unless defined $config->{releases};
|
||||||
|
@ -150,7 +150,7 @@ for my $release (@{$config->{releases}}) {
|
||||||
$release->{url} = $url;
|
$release->{url} = $url;
|
||||||
$release->{cache_url} = "https://docker-perl-artifacts.minio.voots.org/sources/output/downloads/$file";
|
$release->{cache_url} = "https://docker-perl-artifacts.minio.voots.org/sources/output/downloads/$file";
|
||||||
$release->{"cpanm_dist_$_"} = $cpanm{$_} for keys %cpanm;
|
$release->{"cpanm_dist_$_"} = $cpanm{$_} for keys %cpanm;
|
||||||
$release->{base_image} = "gitea.simcop2387.info/simcop2387/perl-os-base";
|
$release->{build_image} = "gitea.simcop2387.info/simcop2387/perl-os-base";
|
||||||
|
|
||||||
$release->{extra_flags} ||= '';
|
$release->{extra_flags} ||= '';
|
||||||
|
|
||||||
|
@ -159,11 +159,13 @@ for my $release (@{$config->{releases}}) {
|
||||||
for my $debian_release (@{$release->{debian_release}}) {
|
for my $debian_release (@{$release->{debian_release}}) {
|
||||||
|
|
||||||
my $output = $template;
|
my $output = $template;
|
||||||
$output =~ s/\{\{$_\}\}/$release->{$_}/mg
|
for (qw(version pause extra_flags sha256 type url image cpanm_dist_name cpanm_dist_url cpanm_dist_sha256 build_image cache_url)) {
|
||||||
for (qw(version pause extra_flags sha256 type url image cpanm_dist_name cpanm_dist_url cpanm_dist_sha256));
|
# print "$_\n";
|
||||||
|
$output =~ s/\{\{$_\}\}/$release->{$_}/mg
|
||||||
|
}
|
||||||
$output =~ s/\{\{args\}\}/$builds{$build}/mg;
|
$output =~ s/\{\{args\}\}/$builds{$build}/mg;
|
||||||
|
|
||||||
$output =~ s/\{\{tag\}\}/$debian_release/mg;
|
$output =~ s/\{\{tag\}\}/debian-$debian_release/mg;
|
||||||
|
|
||||||
my $dir = path(sprintf("output/perls/%i.%03i.%03i-%s-%s", ($release->{version} =~ /(\d+)\.(\d+)\.(\d+)/), $build, $debian_release));
|
my $dir = path(sprintf("output/perls/%i.%03i.%03i-%s-%s", ($release->{version} =~ /(\d+)\.(\d+)\.(\d+)/), $build, $debian_release));
|
||||||
$dir->mkdir();
|
$dir->mkdir();
|
||||||
|
|
Loading…
Add table
Reference in a new issue