Class: Engineyard::Hudson::Install

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/engineyard-hudson/cli/install.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



10
11
12
# File 'lib/engineyard-hudson/cli/install.rb', line 10

def self.source_root
  File.join(File.dirname(__FILE__), "install", "templates")
end

Instance Method Details

#attributesObject



21
22
23
# File 'lib/engineyard-hudson/cli/install.rb', line 21

def attributes
  template "attributes.rb.tt", "cookbooks/hudson_slave/attributes/default.rb"
end

#enable_recipeObject



29
30
31
32
33
34
35
36
37
# File 'lib/engineyard-hudson/cli/install.rb', line 29

def enable_recipe
  file       = "cookbooks/main/recipes/default.rb"
  enable_cmd = "\nrequire_recipe 'hudson_slave'"
  if File.exists?(file_path = File.join(destination_root, file))
    append_file file, enable_cmd
  else
    create_file file, enable_cmd
  end
end

#install_cookbooksObject



14
15
16
17
18
19
# File 'lib/engineyard-hudson/cli/install.rb', line 14

def install_cookbooks
  file       = "cookbooks/main/recipes/default.rb"
  unless File.exists?(File.join(destination_root, "cookbooks/main/recipes/default.rb"))
    directory "cookbooks"
  end
end

#readmeObject



39
40
41
42
43
44
45
46
47
# File 'lib/engineyard-hudson/cli/install.rb', line 39

def readme
  say ""
  say "Finally:"
  say "* edit "; say "cookbooks/hudson_slave/attributes/default.rb ", :yellow; say "as necessary."
  say "* run: "; say "ey recipes upload ", :green; say "# use --environment(-e) & --account(-c)"
  say "* run: "; say "ey recipes apply  ", :green; say "#   to select environment"
  say "* "; say "Boot your environment ", :yellow; say "if not already booted."
  say "When the recipe completes, your project will commence its first build on Hudson CI."
end

#recipeObject



25
26
27
# File 'lib/engineyard-hudson/cli/install.rb', line 25

def recipe
  copy_file "recipes.rb", "cookbooks/hudson_slave/recipes/default.rb"
end