Class: RocketFuel::Install::RecipeRun

Inherits:
Object
  • Object
show all
Defined in:
lib/rocket_fuel/install/recipe_run.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ RecipeRun

Returns a new instance of RecipeRun.



4
5
6
# File 'lib/rocket_fuel/install/recipe_run.rb', line 4

def initialize(options = {})
  @options = options
end

Instance Method Details

#cookbook_nameObject



15
16
17
18
19
20
21
# File 'lib/rocket_fuel/install/recipe_run.rb', line 15

def cookbook_name
  if @options[:vagrant] || !RocketFuel::SystemDetails.platform_family?(:mac)
    'linux'
  else
    'osx'
  end
end

#recipe_nameObject



23
24
25
26
27
28
29
# File 'lib/rocket_fuel/install/recipe_run.rb', line 23

def recipe_name
  if @options[:vagrant]
    'vagrant'
  else
    'default'
  end
end

#runObject



8
9
10
11
12
13
# File 'lib/rocket_fuel/install/recipe_run.rb', line 8

def run
  chdir_cmd = "cd #{RocketFuel::Install::RECIPE_PATH}"
  system("#{chdir_cmd} && sudo chef-solo " +
    "-c cookbooks/fueled-#{cookbook_name}-station/config.rb " +
    "-j cookbooks/fueled-#{cookbook_name}-station/roles/#{recipe_name}.json")
end