Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Dobby/Boxmate/App.pm
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,13 @@ sub _read_plan_file ($self, $filename) {
return YAML::XS::Load($content);
}

sub _write_plan_file ($self, $filename, $data) {
sub _write_plan_file ($self, $filename, $data, $verbose = undef) {
require Path::Tiny;
require YAML::XS;
local $YAML::XS::Boolean = 'boolean';
my $content = YAML::XS::Dump($data);
Path::Tiny::path($filename)->spew($content);
print "Plan:\n" . $content if $verbose;
return;
}

Expand Down
3 changes: 2 additions & 1 deletion lib/Dobby/Boxmate/App/Command/ciplan.pm
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ sub command_names {
sub opt_spec {
return (
[ 'run-id=s', 'CI run id, defaults to $CI_JOB_ID or a guid' ],
[ 'verbose|v', 'Print plan to stdout'],
);
}

Expand Down Expand Up @@ -105,7 +106,7 @@ sub execute ($self, $opt, $args) {
};

my $plan_file = $args->[0] // $self->app->_default_plan_file;
$self->app->_write_plan_file($plan_file, $plan);
$self->app->_write_plan_file($plan_file, $plan, $opt->verbose);
return;
}

Expand Down
Loading