lib/minke/command.rb in minke-1.14.5 vs lib/minke/command.rb in minke-1.15.0

- old
+ new

@@ -1,13 +1,14 @@ module Minke class Command - attr_accessor :config, :generator_config, :verbose + attr_accessor :config, :generator_config, :verbose, :args - def initialize(config, generator_config, verbose) + def initialize(config, generator_config, verbose, args) self.config = config self.generator_config = generator_config self.verbose = verbose + self.args = args end # Creates dependencies for minke def create_dependencies task project_name = "minke#{SecureRandom.urlsafe_base64(12)}".downcase.gsub(/[^0-9a-z ]/i, '') @@ -67,11 +68,12 @@ :test => Minke::Tasks::Test.new(dependencies), :run => Minke::Tasks::Run.new(dependencies), :build_image => Minke::Tasks::BuildImage.new(dependencies), :cucumber => Minke::Tasks::Cucumber.new(dependencies), :push => Minke::Tasks::Push.new(dependencies), - :shell => Minke::Tasks::Shell.new(dependencies) + :shell => Minke::Tasks::Shell.new(dependencies), + :provision => Minke::Tasks::Terraform.new(dependencies) } end def fetch if config.fetch != nil @@ -125,9 +127,16 @@ def shell if config.shell != nil tasks = create_tasks :shell tasks[:shell].run + end + end + + def provision + if config.provision != nil + tasks = create_tasks :provision + tasks[:provision].run self.args[:provision_mode] end end end end