Sha256: dcc5bb2851eb4b4111d744801894ce5462c2c8e546bbefe387d96ebaba0aa286

Contents?: true

Size: 1.2 KB

Versions: 2

Compression:

Stored size: 1.2 KB

Contents

require 'rocket_fuel/install/download'
require 'rocket_fuel/install/chef_install'
require 'rocket_fuel/install/recipe_run'

module RocketFuel
  module Install
    class Run
      include Thor::Base

      def initialize(options = {})
        @download = RocketFuel::Install::Download.new
        @options = options
      end

      def run
        say('Downloading rocket fuel recipes...')
        @download.retrieve
        say('Done.')
        say('Extracting rocket fuel recipes...')
        @download.extract
        say('Done.')
        say('Checking to see if Chef is installed...')
        chef_install = RocketFuel::Install::ChefInstall.new
        if chef_install.installed?
          say('Done')
        else
          say('Installing chef omnibus. You may be prompted for your sudo password..')
          chef_install.run
          say('Done.')
        end
        say('Running rocket fuel recipes...this may take some time')
        run = RocketFuel::Install::RecipeRun.new(options)
        say('')

        if run.run
          say("Congratuations! You're now running with RocketFuel!", :green)
        else
          say('Something went wrong.', :red)
        end
        say('Done')
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rocket_fuel-0.2.0 lib/rocket_fuel/install/run.rb
rocket_fuel-0.1.0 lib/rocket_fuel/install/run.rb