| 1 | package Imager::CommandLine::MakeVagrant { | ||
| 2 | use MooseX::App; | ||
| 3 | use CloudDeploy::Utils; | ||
| 4 | |||
| 5 | parameter ami_class => (is => 'ro', isa => 'Str', required => 1); | ||
| 6 | |||
| 7 | sub run { | ||
| 8 | my ($self) = @_; | ||
| 9 | |||
| 10 | my $module = load_class($self->ami_class); | ||
| 11 | my $obj = $module->{class}->new(params => $module->{params_class}->new_with_options(argv => $self->extra_argv)); | ||
| 12 | |||
| 13 | die "Class is not a CCfnX::MakeAMIBase" if (not $obj->isa('CCfnX::MakeAMIBase')); | ||
| 14 | |||
| 15 | my $deployer = $obj->get_deployer({ | ||
| 16 | },'CCfnX::VagrantDeployer'); | ||
| 17 | |||
| 18 | $deployer->deploy; | ||
| 19 | } | ||
| 20 | } | ||
| 21 | |||
| 22 | 1; |