diff --git a/IFComp-Dev/script/build_zip_of_zips.sh b/IFComp-Dev/script/build_zip_of_zips.sh new file mode 100755 index 00000000..2b0f5519 --- /dev/null +++ b/IFComp-Dev/script/build_zip_of_zips.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +docker compose exec app perl ./script/build_zip_of_zips.pl --docker diff --git a/IFComp/script/build_zip_of_zips.pl b/IFComp/script/build_zip_of_zips.pl index 1dc8fbba..1455f8c2 100644 --- a/IFComp/script/build_zip_of_zips.pl +++ b/IFComp/script/build_zip_of_zips.pl @@ -12,8 +12,14 @@ use Path::Class; use File::Basename; use Archive::Zip qw(AZ_OK); +use Getopt::Long; -my $schema = IFComp::Schema->connect( 'dbi:mysql:ifcomp', 'root', '' ); +my $docker; +GetOptions( 'docker' => \$docker ) + or die "Usage: $0 [--docker]\n"; + +my $dsn = $docker ? 'dbi:mysql:database=ifcomp;host=db' : 'dbi:mysql:ifcomp'; +my $schema = IFComp::Schema->connect( $dsn, 'root', '' ); $schema->entry_directory( Path::Class::Dir->new("$FindBin::Bin/../entries") ); my $comp = $schema->resultset('Comp');