From dacba0bde02bf2fde393260ab7429a79fa8950f1 Mon Sep 17 00:00:00 2001 From: Shlomi Fish Date: Sat, 4 Apr 2020 11:12:54 +0300 Subject: [PATCH] Extract a common module/library/header. This is Refactoring / code cleanup. See: * https://github.com/shlomif/Docker-CLI-Wrapper . --- scripts/debian-packaging/docker-test.pl | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/scripts/debian-packaging/docker-test.pl b/scripts/debian-packaging/docker-test.pl index ea578f5..667f3c7 100644 --- a/scripts/debian-packaging/docker-test.pl +++ b/scripts/debian-packaging/docker-test.pl @@ -23,13 +23,7 @@ my @deps; #= map { /^BuildRequires:\s*(\S+)/ ? ("'$1'") : () } my $USER = "mygbp"; my $HOMEDIR = "/home/$USER"; -sub _clean_up_containers -{ - eval { $obj->docker( { cmd => [ 'stop', $obj->container(), ] } ); }; - - eval { $obj->docker( { cmd => [ 'rm', $obj->container(), ] } ); }; -} -_clean_up_containers(); +$obj->clean_up(); $obj->docker( { cmd => [ 'pull', $obj->sys() ] } ); $obj->docker( { cmd => [ 'run', "-t", "-d", "--name", $obj->container(), $obj->sys(), ] } @@ -93,7 +87,7 @@ $obj->docker( $obj->docker( { cmd => [ 'cp', $obj->container() . ":$HOMEDIR/$LOG_FN", $LOG_FN, ] } ); -_clean_up_containers(); +$obj->clean_up(); __END__ -- 2.40.0