| 1 | package CCfnX::ImportBase { | ||
| 2 | use Moose; | ||
| 3 | use CCfnX::VirtualDeployment; | ||
| 4 | use CCfnX::PersistentDeployment; | ||
| 5 | use Data::Printer; | ||
| 6 | |||
| 7 | sub get_deployer { | ||
| 8 | my $self = shift; | ||
| 9 | |||
| 10 | my @roles; | ||
| 11 | if ($ENV{ CLOUDDEPLOY_PERSIST }) { | ||
| 12 | push @roles, 'CCfnX::PersistentDeployment'; | ||
| 13 | } else { | ||
| 14 | warn 'To persist the stack to the database, please activate ENV CLOUDDEPLOY_PERSIST'; | ||
| 15 | } | ||
| 16 | |||
| 17 | my $new_class = Moose::Util::with_traits('CCfnX::VirtualDeployment', @roles); | ||
| 18 | |||
| 19 | my $deployer = $new_class->new(origin => $self); | ||
| 20 | |||
| 21 | print "These are your outputs\n"; | ||
| 22 | p $deployer->outputs; | ||
| 23 | |||
| 24 | return $deployer; | ||
| 25 | } | ||
| 26 | } | ||
| 27 | |||
| 28 | 1; |