~mclehman/guestctl

82b8e7a0fa718a6067697fef20c088d617c42a5f — Max Lehman 5 years ago 634e46f
Implement commit and revuild functionality.
2 files changed, 5 insertions(+), 2 deletions(-)

M META6.json
M bin/guestctl
M META6.json => META6.json +1 -1
@@ 11,7 11,7 @@
        "templates/docker-compose.tmpl",
        "templates/sshd_config.tmpl"
    ],
    "version" : "0.0.4",
    "version" : "0.0.5",
    "production" : false,
    "perl" : "v6.*",
    "authors" : [

M bin/guestctl => bin/guestctl +4 -1
@@ 52,8 52,11 @@ multi MAIN($guest, GuestAction $action) {
            my $container-id = run(<<docker-compose ps -q $guest>>, :out, cwd => $guest-dir).out.slurp.chomp;
            my $commit-epoch-time = now.to-posix.head.Int;
            my $committed-image = "guest-" ~ $guest ~ ":" ~ $commit-epoch-time;
            my $live-image = "guest-" ~ $guest ~ ":live";
            note qq{Committing guest "$guest" to image $committed-image.};
            transparent-run <<docker commit $container-id $committed-image>>, cwd => $guest-dir;
            transparent-run <<docker commit $container-id $committed-image>>, cwd => $guest-dir, :proceed;
            transparent-run <<docker tag $committed-image $live-image>>, cwd => $guest-dir, :proceed;
            transparent-run <<docker-compose up -d>>, cwd => $guest-dir, :proceed;
        }

        default {