3 # Short description for docker-test.pl
5 # Author Shlomi Fish <shlomif@cpan.org>
7 # Copyright (C) 2019 Shlomi Fish <shlomif@cpan.org>
14 use Path::Tiny qw/ path tempdir tempfile cwd /;
20 my $cmd = $args->{cmd};
21 print "Running [@$cmd]\n";
24 die "Running [@$cmd] failed!";
28 my @deps; #= map { /^BuildRequires:\s*(\S+)/ ? ("'$1'") : () }
30 # path("freecell-solver.spec.in")->lines_utf8;
31 my $SYS = "debian:sid";
32 my $CONTAINER = "fortune-mod--deb--test-build";
33 do_system( { cmd => [ 'docker', 'pull', $SYS ] } );
35 { cmd => [ 'docker', 'run', "-t", "-d", "--name", $CONTAINER, $SYS, ] } );
36 my $REPO = 'fortune-mod';
37 my $URL = "https://salsa.debian.org/shlomif-guest/$REPO";
40 do_system( { cmd => [ "git", "clone", $URL, ] } );
44 do_system( { cmd => [ "git", "pull", "--ff-only", ] } );
46 do_system( { cmd => [ 'docker', 'cp', "./$REPO", "$CONTAINER:$REPO", ] } );
48 my $LOG_FN = "git-buildpackage-log.txt";
50 # do_system( { cmd => [ 'docker', 'cp', "../scripts", "fcsfed:scripts", ] } );
51 my $script = <<"EOSCRIPTTTTTTT";
53 sudo apt -y install build-essential cmake git-buildpackage perl
56 gbp buildpackage 2>&1 | tee ~/"$LOG_FN"
60 { cmd => [ 'docker', 'exec', $CONTAINER, 'bash', '-c', $script, ] } );
61 do_system( { cmd => [ 'docker', 'cp', "$CONTAINER:$LOG_FN", $LOG_FN, ] } );
63 do_system( { cmd => [ 'docker', 'stop', $CONTAINER, ] } );
64 do_system( { cmd => [ 'docker', 'rm', $CONTAINER, ] } );
68 =head1 COPYRIGHT & LICENSE
70 Copyright 2019 by Shlomi Fish
72 This program is distributed under the MIT / Expat License:
73 L<http://www.opensource.org/licenses/mit-license.php>
75 Permission is hereby granted, free of charge, to any person
76 obtaining a copy of this software and associated documentation
77 files (the "Software"), to deal in the Software without
78 restriction, including without limitation the rights to use,
79 copy, modify, merge, publish, distribute, sublicense, and/or sell
80 copies of the Software, and to permit persons to whom the
81 Software is furnished to do so, subject to the following
84 The above copyright notice and this permission notice shall be
85 included in all copies or substantial portions of the Software.
87 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
88 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
89 OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
90 NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
91 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
92 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
93 FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
94 OTHER DEALINGS IN THE SOFTWARE.