engineyard-recipes 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ChangeLog.md +5 -0
- data/README.md +30 -0
- data/features/clone-recipe.feature +9 -9
- data/features/generate-helper-definitions.feature +10 -2
- data/features/{generate-recipe.feature → generate-recipe-in-cookbook.feature} +16 -4
- data/features/init-new-cookbook.feature +18 -0
- data/features/timezone_override.feature +15 -1
- data/lib/engineyard-recipes/cli.rb +24 -9
- data/lib/engineyard-recipes/generators/base_generator.rb +32 -0
- data/lib/engineyard-recipes/generators/definition_generator.rb +3 -5
- data/lib/engineyard-recipes/generators/init_generator/templates/deploy/before_migrate.rb +2 -0
- data/lib/engineyard-recipes/generators/init_generator/templates/deploy/solo.rb +7 -0
- data/lib/engineyard-recipes/generators/init_generator.rb +15 -7
- data/lib/engineyard-recipes/generators/init_sm_generator.rb +5 -14
- data/lib/engineyard-recipes/generators/local_recipe_clone_generator.rb +7 -9
- data/lib/engineyard-recipes/generators/recipe_generator.rb +13 -12
- data/lib/engineyard-recipes/generators/sm_generator.rb +6 -11
- data/lib/engineyard-recipes/generators/timezone_generator.rb +5 -10
- data/lib/engineyard-recipes/version.rb +1 -1
- metadata +26 -17
data/ChangeLog.md
CHANGED
@@ -1,5 +1,10 @@
|
|
1
1
|
# ChangeLog
|
2
2
|
|
3
|
+
## v0.3.pre
|
4
|
+
|
5
|
+
* `--local` (clone, recipes, definitions) - generates into local path instead of cookbooks/ subfolder; useful for developing dedicated recipe repositories instead of an entire cookbook; ignores cookbooks/main/recipes/default.rb
|
6
|
+
* `init -d` - enables "run chef during deploy". Cookbooks generated into `deploy/cookbooks/` instead of `cookbooks/`
|
7
|
+
|
3
8
|
## v0.2
|
4
9
|
|
5
10
|
Timezones & SM Extensions
|
data/README.md
CHANGED
@@ -20,6 +20,17 @@ $ ey-recipes clone /tmp/recipes/ey-dnapi
|
|
20
20
|
$ ey recipes upload --apply
|
21
21
|
```
|
22
22
|
|
23
|
+
Alternately, you can have chef recipes run during deployment rather than by explicitly running them:
|
24
|
+
|
25
|
+
```
|
26
|
+
$ cd /path/to/my/app
|
27
|
+
$ ey-recipes init -d
|
28
|
+
$ ey-recipes recipe somepackage
|
29
|
+
|
30
|
+
# then deploy to apply recipes
|
31
|
+
$ ey deploy
|
32
|
+
```
|
33
|
+
|
23
34
|
## Usage
|
24
35
|
|
25
36
|
Getting started:
|
@@ -32,6 +43,25 @@ $ ey-recipes init
|
|
32
43
|
create cookbooks/main/libraries/ruby_block.rb
|
33
44
|
create cookbooks/main/libraries/run_for_app.rb
|
34
45
|
create cookbooks/main/recipes/default.rb
|
46
|
+
|
47
|
+
$ ey recipes upload
|
48
|
+
$ ey recipes apply
|
49
|
+
```
|
50
|
+
|
51
|
+
The `-d` or `--on-deploy` flag will setup your application to run recipes during each deployment.
|
52
|
+
|
53
|
+
```
|
54
|
+
$ cd /path/to/my/app
|
55
|
+
$ ey-recipes init --on-deploy
|
56
|
+
create deploy/before_migrate.rb
|
57
|
+
create deploy/solo.rb
|
58
|
+
create deploy/cookbooks/main/attributes/recipe.rb
|
59
|
+
create deploy/cookbooks/main/definitions/ey_cloud_report.rb
|
60
|
+
create deploy/cookbooks/main/libraries/ruby_block.rb
|
61
|
+
create deploy/cookbooks/main/libraries/run_for_app.rb
|
62
|
+
create deploy/cookbooks/main/recipes/default.rb
|
63
|
+
|
64
|
+
$ ey deploy
|
35
65
|
```
|
36
66
|
|
37
67
|
Quickly generate recipes from git repositories or local folders. See bottom of README for community examples.
|
@@ -34,18 +34,18 @@ Feature: Clone recipe from git repositories
|
|
34
34
|
append cookbooks/main/recipes/default.rb
|
35
35
|
"""
|
36
36
|
|
37
|
-
Scenario: Clone recipe
|
38
|
-
Given I am have a local recipe "
|
39
|
-
When I run local executable "ey-recipes" with arguments "clone /tmp/ey-recipes/
|
40
|
-
Then file "
|
41
|
-
And file "
|
37
|
+
Scenario: Clone a single recipe from a local folder into local folder instead of in cookbooks/
|
38
|
+
Given I am have a local recipe "blank" at "/tmp/ey-recipes/blank"
|
39
|
+
When I run local executable "ey-recipes" with arguments "clone /tmp/ey-recipes/blank --local"
|
40
|
+
Then file "blank/README.rdoc" is created
|
41
|
+
And file "blank/README.rdoc" contains "This is a local recipe"
|
42
42
|
And I should see exactly
|
43
43
|
"""
|
44
|
-
exist
|
45
|
-
create
|
46
|
-
create
|
44
|
+
exist
|
45
|
+
create blank/README.rdoc
|
46
|
+
create blank/recipes/default.rb
|
47
47
|
"""
|
48
|
-
|
48
|
+
|
49
49
|
Scenario: Clone URI is an unknown local path
|
50
50
|
When I run local executable "ey-recipes" with arguments "clone /tmp/ey-recipes/UNKNOWN"
|
51
51
|
And I should see exactly
|
@@ -25,5 +25,13 @@ Feature: Generate helper definitions recipe
|
|
25
25
|
create cookbooks/mylibrary/definitions/helper2.rb
|
26
26
|
"""
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
Scenario: Generate a new recipe into local folder instead of in cookbooks/
|
29
|
+
When I run local executable "ey-recipes" with arguments "definition mylibrary helper1 --local"
|
30
|
+
And file "mylibrary/definitions/helper1.rb" is created
|
31
|
+
And file "mylibrary/definitions/helper1.rb" contains "define :helper1 do"
|
32
|
+
And I should see exactly
|
33
|
+
"""
|
34
|
+
exist
|
35
|
+
create mylibrary/definitions/helper1.rb
|
36
|
+
"""
|
37
|
+
|
@@ -1,4 +1,4 @@
|
|
1
|
-
Feature: Generate package recipe
|
1
|
+
Feature: Generate package recipe into cookbook
|
2
2
|
I want to generate a new chef recipe for a package
|
3
3
|
And it is automatically included in the main recipe/run
|
4
4
|
|
@@ -82,6 +82,18 @@ Feature: Generate package recipe
|
|
82
82
|
|
83
83
|
"""
|
84
84
|
|
85
|
-
|
86
|
-
|
87
|
-
|
85
|
+
Scenario: Generate a new recipe into local folder instead of in cookbooks/
|
86
|
+
When I run local executable "ey-recipes" with arguments "recipe component --local"
|
87
|
+
And file "component/recipes/default.rb" is created
|
88
|
+
And file "component/recipes/default.rb" contains "require_recipe 'component::install'"
|
89
|
+
And file "component/recipes/install.rb" is created
|
90
|
+
And file "component/attributes/recipe.rb" is created
|
91
|
+
And file "component/attributes/recipe.rb" contains "# component_version('1.0.0')"
|
92
|
+
And I should see exactly
|
93
|
+
"""
|
94
|
+
exist
|
95
|
+
create component/attributes/recipe.rb
|
96
|
+
create component/recipes/default.rb
|
97
|
+
create component/recipes/install.rb
|
98
|
+
"""
|
99
|
+
|
@@ -14,3 +14,21 @@ Feature: Generate a new custom cookbook for your EY Cloud environments
|
|
14
14
|
create cookbooks/main/libraries/run_for_app.rb
|
15
15
|
create cookbooks/main/recipes/default.rb
|
16
16
|
"""
|
17
|
+
|
18
|
+
Scenario: Run cookbooks during deployments
|
19
|
+
Given I am in the "rails" project folder
|
20
|
+
When I run local executable "ey-recipes" with arguments "init -d"
|
21
|
+
And file "deploy/before_migrate.rb" is created
|
22
|
+
And file "deploy/cookbooks/main/recipes/default.rb" is created
|
23
|
+
And I should see exactly
|
24
|
+
"""
|
25
|
+
create deploy
|
26
|
+
create deploy/before_migrate.rb
|
27
|
+
create deploy/solo.rb
|
28
|
+
create deploy/cookbooks
|
29
|
+
create deploy/cookbooks/main/attributes/recipe.rb
|
30
|
+
create deploy/cookbooks/main/definitions/ey_cloud_report.rb
|
31
|
+
create deploy/cookbooks/main/libraries/ruby_block.rb
|
32
|
+
create deploy/cookbooks/main/libraries/run_for_app.rb
|
33
|
+
create deploy/cookbooks/main/recipes/default.rb
|
34
|
+
"""
|
@@ -3,9 +3,9 @@ Feature: Timezone override
|
|
3
3
|
|
4
4
|
Background:
|
5
5
|
Given I am in the "rails" project folder
|
6
|
-
When I run local executable "ey-recipes" with arguments "init"
|
7
6
|
|
8
7
|
Scenario: Set the timezone I want
|
8
|
+
When I run local executable "ey-recipes" with arguments "init"
|
9
9
|
When I run local executable "ey-recipes" with arguments "timezone Australia/Tasmania"
|
10
10
|
Then file "cookbooks/timezone-override/recipes/default.rb" contains
|
11
11
|
"""
|
@@ -33,8 +33,22 @@ Feature: Timezone override
|
|
33
33
|
create cookbooks/timezone-override/recipes/default.rb
|
34
34
|
append cookbooks/main/recipes/default.rb
|
35
35
|
"""
|
36
|
+
|
37
|
+
Scenario: Set timezone into deploy/cookbooks/ rather than cookbooks/
|
38
|
+
When I run local executable "ey-recipes" with arguments "init -d"
|
39
|
+
When I run local executable "ey-recipes" with arguments "timezone Australia/Tasmania"
|
40
|
+
Then file "deploy/cookbooks/main/recipes/default.rb" contains "require_recipe 'timezone-override'"
|
41
|
+
And I should see exactly
|
42
|
+
"""
|
43
|
+
exist deploy/cookbooks
|
44
|
+
create deploy/cookbooks/timezone-override/recipes/default.rb
|
45
|
+
append deploy/cookbooks/main/recipes/default.rb
|
46
|
+
"""
|
47
|
+
|
48
|
+
|
36
49
|
|
37
50
|
Scenario: Cannot set an invalid timezone
|
51
|
+
When I run local executable "ey-recipes" with arguments "init"
|
38
52
|
When I run local executable "ey-recipes" with arguments "timezone XXXX"
|
39
53
|
And file "cookbooks/main/recipes/default.rb" does not contain "require_recipe 'timezone-override'"
|
40
54
|
And I should see exactly
|
@@ -1,16 +1,20 @@
|
|
1
1
|
require 'thor'
|
2
2
|
require 'engineyard-recipes/thor-ext/actions/directory'
|
3
3
|
require 'engineyard-recipes/fetch_uri'
|
4
|
+
require 'engineyard-recipes/generators/base_generator'
|
4
5
|
|
5
6
|
module Engineyard
|
6
7
|
module Recipes
|
7
8
|
class CLI < Thor
|
8
9
|
|
9
10
|
desc "init", "Creates cookbooks scaffolding for your recipes"
|
11
|
+
method_option :"on-deploy", :aliases => ['-d'], :type => :boolean, :desc => "Run recipes during deployment"
|
10
12
|
method_option :sm, :type => :boolean, :desc => "Also install SM framework support"
|
11
13
|
def init
|
14
|
+
on_deploy = options["on-deploy"] || false
|
15
|
+
|
12
16
|
require 'engineyard-recipes/generators/init_generator'
|
13
|
-
Engineyard::Recipes::Generators::InitGenerator.start
|
17
|
+
Engineyard::Recipes::Generators::InitGenerator.start([on_deploy])
|
14
18
|
init_sm if options[:sm]
|
15
19
|
end
|
16
20
|
|
@@ -24,19 +28,26 @@ module Engineyard
|
|
24
28
|
method_option :package, :aliases => ['-p'], :desc => "Gentoo package name, e.g. dev-util/gitosis-gentoo"
|
25
29
|
method_option :version, :aliases => ['-v'], :desc => "Gentoo package version, e.g. 0.2_p20081028"
|
26
30
|
method_options %w( unmasked -u ) => :boolean, :desc => "Unmask the required gentoo package"
|
31
|
+
method_option :local, :aliases => ['-l'], :type => :boolean, :desc => "Generate into local folder, instead of cookbooks/RECIPE_NAME"
|
27
32
|
def recipe(recipe_name)
|
28
|
-
package
|
29
|
-
version
|
30
|
-
unmasked
|
31
|
-
|
33
|
+
package = options["package"] || "UNKNOWN/#{recipe_name}"
|
34
|
+
version = options["version"] || '1.0.0'
|
35
|
+
unmasked = options["unmasked"] || false
|
36
|
+
local = options["local"] || false
|
37
|
+
|
32
38
|
require 'engineyard-recipes/generators/recipe_generator'
|
33
|
-
Engineyard::Recipes::Generators::RecipeGenerator.start([
|
39
|
+
Engineyard::Recipes::Generators::RecipeGenerator.start([
|
40
|
+
recipe_name, package, version, {:unmasked => unmasked, :local => local}
|
41
|
+
])
|
34
42
|
end
|
35
43
|
|
36
44
|
desc "definition RECIPE DEFINITION", "Generate recipe for a package"
|
45
|
+
method_option :local, :aliases => ['-l'], :type => :boolean, :desc => "Generate into local folder, instead of cookbooks/RECIPE_NAME"
|
37
46
|
def definition(recipe_name, definition_name)
|
47
|
+
local = options["local"] || false
|
48
|
+
|
38
49
|
require 'engineyard-recipes/generators/definition_generator'
|
39
|
-
Engineyard::Recipes::Generators::DefinitionGenerator.start([recipe_name, definition_name])
|
50
|
+
Engineyard::Recipes::Generators::DefinitionGenerator.start([recipe_name, definition_name, {:local => local}])
|
40
51
|
end
|
41
52
|
|
42
53
|
desc "timezone TIMEZONE", "Generate recipe to set the timezone"
|
@@ -49,11 +60,15 @@ module Engineyard
|
|
49
60
|
|
50
61
|
desc "clone URI", "Clone a recipe into cookbook. URI can be git or local path."
|
51
62
|
method_option :name, :aliases => ['-n'], :desc => "Specify name of recipe. Defaults to base name."
|
63
|
+
method_option :local, :aliases => ['-l'], :type => :boolean, :desc => "Generate into local folder, instead of cookbooks/RECIPE_NAME"
|
52
64
|
def clone(folder_path) # TODO support git URIs
|
65
|
+
local = options["local"] || false
|
66
|
+
|
53
67
|
require 'engineyard-recipes/generators/local_recipe_clone_generator'
|
54
68
|
generator = Engineyard::Recipes::Generators::LocalRecipeCloneGenerator
|
55
|
-
|
56
|
-
generator.start([recipe_name])
|
69
|
+
_, recipe_name = FetchUri.fetch_recipe(folder_path, generator.source_root, options["name"])
|
70
|
+
generator.start([recipe_name, {:local => local}])
|
71
|
+
|
57
72
|
rescue Engineyard::Recipes::FetchUri::UnknownPath => e
|
58
73
|
error "No recipe found at #{e.message}"
|
59
74
|
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require 'thor/group'
|
2
|
+
|
3
|
+
module Engineyard::Recipes
|
4
|
+
module Generators
|
5
|
+
class BaseGenerator < Thor::Group
|
6
|
+
include Thor::Actions
|
7
|
+
|
8
|
+
protected
|
9
|
+
def cookbooks_destination
|
10
|
+
@cookbooks_destination ||= begin
|
11
|
+
return "." if self.respond_to?(:flags) && flags[:local] # check for bonus --local flag in CLI
|
12
|
+
possible_paths = ['deploy/cookbooks', 'cookbooks']
|
13
|
+
destination = possible_paths.find do |cookbooks|
|
14
|
+
Dir.exist?(File.join(destination_root, cookbooks))
|
15
|
+
end
|
16
|
+
unless destination
|
17
|
+
error "Cannot discover cookbooks folder"
|
18
|
+
end
|
19
|
+
destination
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
def cookbooks_dir(child_path)
|
24
|
+
File.join(cookbooks_destination, child_path)
|
25
|
+
end
|
26
|
+
|
27
|
+
def say(msg, color = nil)
|
28
|
+
color ? shell.say(msg, color) : shell.say(msg)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
end
|
@@ -2,24 +2,22 @@ require 'thor/group'
|
|
2
2
|
|
3
3
|
module Engineyard::Recipes
|
4
4
|
module Generators
|
5
|
-
class DefinitionGenerator <
|
5
|
+
class DefinitionGenerator < BaseGenerator
|
6
6
|
include Thor::Actions
|
7
7
|
|
8
8
|
argument :recipe_name
|
9
9
|
argument :definition_name
|
10
|
+
argument :flags, :type => :hash
|
10
11
|
|
11
12
|
def self.source_root
|
12
13
|
File.join(File.dirname(__FILE__), "definition_generator", "templates")
|
13
14
|
end
|
14
15
|
|
15
16
|
def install_cookbooks
|
16
|
-
directory "cookbooks"
|
17
|
+
directory "cookbooks", cookbooks_destination
|
17
18
|
end
|
18
19
|
|
19
20
|
private
|
20
|
-
def say(msg, color = nil)
|
21
|
-
color ? shell.say(msg, color) : shell.say(msg)
|
22
|
-
end
|
23
21
|
end
|
24
22
|
end
|
25
23
|
end
|
@@ -2,23 +2,31 @@ require 'thor/group'
|
|
2
2
|
|
3
3
|
module Engineyard::Recipes
|
4
4
|
module Generators
|
5
|
-
class InitGenerator <
|
5
|
+
class InitGenerator < BaseGenerator
|
6
6
|
include Thor::Actions
|
7
|
+
|
8
|
+
argument :on_deploy, :optional => true
|
7
9
|
|
8
10
|
def self.source_root
|
9
11
|
File.join(File.dirname(__FILE__), "init_generator", "templates")
|
10
12
|
end
|
11
13
|
|
12
14
|
def install_cookbooks
|
13
|
-
|
14
|
-
|
15
|
-
|
15
|
+
if on_deploy
|
16
|
+
directory "deploy"
|
17
|
+
end
|
18
|
+
unless File.exists?(File.join(destination_root, "#{cookbooks_destination}/main/recipes/default.rb"))
|
19
|
+
directory "cookbooks", cookbooks_destination
|
16
20
|
end
|
17
21
|
end
|
18
22
|
|
19
|
-
|
20
|
-
def
|
21
|
-
|
23
|
+
protected
|
24
|
+
def cookbooks_destination
|
25
|
+
if on_deploy
|
26
|
+
"deploy/cookbooks"
|
27
|
+
else
|
28
|
+
"cookbooks"
|
29
|
+
end
|
22
30
|
end
|
23
31
|
end
|
24
32
|
end
|
@@ -2,7 +2,7 @@ require 'thor/group'
|
|
2
2
|
|
3
3
|
module Engineyard::Recipes
|
4
4
|
module Generators
|
5
|
-
class InitSmGenerator <
|
5
|
+
class InitSmGenerator < BaseGenerator
|
6
6
|
include Thor::Actions
|
7
7
|
|
8
8
|
def self.source_root
|
@@ -14,21 +14,12 @@ module Engineyard::Recipes
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def auto_require_package
|
17
|
-
file
|
18
|
-
|
19
|
-
|
20
|
-
puts "Skipping auto-require of package recipe: #{file} is missing"
|
21
|
-
else
|
22
|
-
require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
|
23
|
-
append_to_file file, require_recipe
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
private
|
28
|
-
def say(msg, color = nil)
|
29
|
-
color ? shell.say(msg, color) : shell.say(msg)
|
17
|
+
file = cookbooks_dir("main/recipes/default.rb")
|
18
|
+
require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
|
19
|
+
append_to_file file, require_recipe
|
30
20
|
end
|
31
21
|
|
22
|
+
private
|
32
23
|
def recipe_name
|
33
24
|
'sm'
|
34
25
|
end
|
@@ -2,33 +2,31 @@ require 'thor/group'
|
|
2
2
|
|
3
3
|
module Engineyard::Recipes
|
4
4
|
module Generators
|
5
|
-
class LocalRecipeCloneGenerator <
|
5
|
+
class LocalRecipeCloneGenerator < BaseGenerator
|
6
6
|
include Thor::Actions
|
7
7
|
|
8
8
|
argument :recipe_name
|
9
|
+
argument :flags, :type => :hash
|
9
10
|
|
10
11
|
def self.source_root
|
11
12
|
@tmpdir ||= Dir.mktmpdir
|
12
13
|
end
|
13
14
|
|
14
15
|
def install_cookbooks
|
15
|
-
directory "cookbooks"
|
16
|
+
directory "cookbooks", cookbooks_destination
|
16
17
|
end
|
17
18
|
|
18
19
|
def auto_require_package
|
19
|
-
|
20
|
-
|
21
|
-
if !File.exists?(file_path)
|
22
|
-
puts "Skipping auto-require of package recipe: #{file} is missing"
|
23
|
-
elsif File.directory?(File.join(self.class.source_root, "cookbooks", recipe_name, "recipes"))
|
20
|
+
unless local?
|
21
|
+
file = cookbooks_dir "main/recipes/default.rb"
|
24
22
|
require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
|
25
23
|
append_to_file file, require_recipe
|
26
24
|
end
|
27
25
|
end
|
28
26
|
|
29
27
|
private
|
30
|
-
def
|
31
|
-
|
28
|
+
def local?
|
29
|
+
flags[:local]
|
32
30
|
end
|
33
31
|
end
|
34
32
|
end
|
@@ -2,41 +2,42 @@ require 'thor/group'
|
|
2
2
|
|
3
3
|
module Engineyard::Recipes
|
4
4
|
module Generators
|
5
|
-
class RecipeGenerator <
|
5
|
+
class RecipeGenerator < BaseGenerator
|
6
6
|
include Thor::Actions
|
7
7
|
|
8
8
|
argument :recipe_name
|
9
9
|
argument :package
|
10
10
|
argument :version
|
11
|
-
argument :
|
11
|
+
argument :flags, :type => :hash # :unmasked & :local
|
12
12
|
|
13
13
|
def self.source_root
|
14
14
|
File.join(File.dirname(__FILE__), "recipe_generator", "templates")
|
15
15
|
end
|
16
16
|
|
17
17
|
def install_cookbooks
|
18
|
-
directory "cookbooks"
|
18
|
+
directory "cookbooks", cookbooks_destination
|
19
19
|
end
|
20
20
|
|
21
21
|
def auto_require_package
|
22
|
-
|
23
|
-
|
24
|
-
unless File.exists?(file_path)
|
25
|
-
puts "Skipping auto-require of package recipe: #{file} is missing"
|
26
|
-
else
|
22
|
+
unless local?
|
23
|
+
file = cookbooks_dir "main/recipes/default.rb"
|
27
24
|
require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
|
28
25
|
append_to_file file, require_recipe
|
29
26
|
end
|
30
27
|
end
|
31
28
|
|
32
29
|
private
|
33
|
-
def say(msg, color = nil)
|
34
|
-
color ? shell.say(msg, color) : shell.say(msg)
|
35
|
-
end
|
36
|
-
|
37
30
|
def known_package?
|
38
31
|
package =~ /UNKNOWN/
|
39
32
|
end
|
33
|
+
|
34
|
+
def local?
|
35
|
+
flags[:local]
|
36
|
+
end
|
37
|
+
|
38
|
+
def unmasked
|
39
|
+
flags[:unmasked]
|
40
|
+
end
|
40
41
|
end
|
41
42
|
end
|
42
43
|
end
|
@@ -2,7 +2,7 @@ require 'thor/group'
|
|
2
2
|
|
3
3
|
module Engineyard::Recipes
|
4
4
|
module Generators
|
5
|
-
class SmGenerator <
|
5
|
+
class SmGenerator < BaseGenerator
|
6
6
|
include Thor::Actions
|
7
7
|
attr_accessor :command
|
8
8
|
|
@@ -16,27 +16,22 @@ module Engineyard::Recipes
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def install_cookbooks
|
19
|
-
directory "cookbooks"
|
19
|
+
directory "cookbooks", cookbooks_destination
|
20
20
|
end
|
21
21
|
|
22
22
|
def wrap_commands
|
23
23
|
template_file = 'command_recipe.rb.tt'
|
24
24
|
sm_ext_commands.each do |command|
|
25
25
|
self.command = command # for the template
|
26
|
-
recipe = "
|
26
|
+
recipe = cookbooks_dir "#{recipe_name}/recipes/#{command}.rb"
|
27
27
|
template(template_file, recipe)
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
31
|
def auto_require_package
|
32
|
-
file = "
|
33
|
-
|
34
|
-
|
35
|
-
puts "Skipping auto-require of package recipe: #{file} is missing"
|
36
|
-
else
|
37
|
-
require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
|
38
|
-
append_to_file file, require_recipe
|
39
|
-
end
|
32
|
+
file = cookbooks_dir "main/recipes/default.rb"
|
33
|
+
require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
|
34
|
+
append_to_file file, require_recipe
|
40
35
|
end
|
41
36
|
|
42
37
|
private
|
@@ -2,7 +2,7 @@ require 'thor/group'
|
|
2
2
|
|
3
3
|
module Engineyard::Recipes
|
4
4
|
module Generators
|
5
|
-
class TimezoneGenerator <
|
5
|
+
class TimezoneGenerator < BaseGenerator
|
6
6
|
include Thor::Actions
|
7
7
|
class InvalidTimezone < StandardError; end
|
8
8
|
|
@@ -17,18 +17,13 @@ module Engineyard::Recipes
|
|
17
17
|
end
|
18
18
|
|
19
19
|
def install_cookbooks
|
20
|
-
directory "cookbooks"
|
20
|
+
directory "cookbooks", cookbooks_destination
|
21
21
|
end
|
22
22
|
|
23
23
|
def auto_require_package
|
24
|
-
file = "
|
25
|
-
|
26
|
-
|
27
|
-
puts "Skipping auto-require of package recipe: #{file} is missing"
|
28
|
-
else
|
29
|
-
require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
|
30
|
-
append_to_file file, require_recipe
|
31
|
-
end
|
24
|
+
file = cookbooks_dir "main/recipes/default.rb"
|
25
|
+
require_recipe = "\nrequire_recipe '#{recipe_name}'\n"
|
26
|
+
append_to_file file, require_recipe
|
32
27
|
end
|
33
28
|
|
34
29
|
protected
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: engineyard-recipes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-03-10 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: thor
|
16
|
-
requirement: &
|
16
|
+
requirement: &70245634380360 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.14.6
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *70245634380360
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: engineyard
|
27
|
-
requirement: &
|
27
|
+
requirement: &70245634379840 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ~>
|
@@ -32,10 +32,10 @@ dependencies:
|
|
32
32
|
version: 1.4.6
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *70245634379840
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: rake
|
38
|
-
requirement: &
|
38
|
+
requirement: &70245634379360 !ruby/object:Gem::Requirement
|
39
39
|
none: false
|
40
40
|
requirements:
|
41
41
|
- - ~>
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
version: 0.9.2
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70245634379360
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: cucumber
|
49
|
-
requirement: &
|
49
|
+
requirement: &70245634378880 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -54,10 +54,10 @@ dependencies:
|
|
54
54
|
version: 1.1.2
|
55
55
|
type: :development
|
56
56
|
prerelease: false
|
57
|
-
version_requirements: *
|
57
|
+
version_requirements: *70245634378880
|
58
58
|
- !ruby/object:Gem::Dependency
|
59
59
|
name: rspec
|
60
|
-
requirement: &
|
60
|
+
requirement: &70245634378400 !ruby/object:Gem::Requirement
|
61
61
|
none: false
|
62
62
|
requirements:
|
63
63
|
- - ~>
|
@@ -65,10 +65,10 @@ dependencies:
|
|
65
65
|
version: 2.7.0
|
66
66
|
type: :development
|
67
67
|
prerelease: false
|
68
|
-
version_requirements: *
|
68
|
+
version_requirements: *70245634378400
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: launchy
|
71
|
-
requirement: &
|
71
|
+
requirement: &70245634385960 !ruby/object:Gem::Requirement
|
72
72
|
none: false
|
73
73
|
requirements:
|
74
74
|
- - ! '>='
|
@@ -76,7 +76,7 @@ dependencies:
|
|
76
76
|
version: '0'
|
77
77
|
type: :development
|
78
78
|
prerelease: false
|
79
|
-
version_requirements: *
|
79
|
+
version_requirements: *70245634385960
|
80
80
|
description: Tools to generate, upload, test and apply chef recipes for Engine Yard
|
81
81
|
Cloud.
|
82
82
|
email:
|
@@ -97,7 +97,7 @@ files:
|
|
97
97
|
- engineyard-recipes.gemspec
|
98
98
|
- features/clone-recipe.feature
|
99
99
|
- features/generate-helper-definitions.feature
|
100
|
-
- features/generate-recipe.feature
|
100
|
+
- features/generate-recipe-in-cookbook.feature
|
101
101
|
- features/init-new-cookbook.feature
|
102
102
|
- features/init-sm-framework.feature
|
103
103
|
- features/step_definitions/api_steps.rb
|
@@ -117,6 +117,7 @@ files:
|
|
117
117
|
- lib/engineyard-recipes.rb
|
118
118
|
- lib/engineyard-recipes/cli.rb
|
119
119
|
- lib/engineyard-recipes/fetch_uri.rb
|
120
|
+
- lib/engineyard-recipes/generators/base_generator.rb
|
120
121
|
- lib/engineyard-recipes/generators/definition_generator.rb
|
121
122
|
- lib/engineyard-recipes/generators/definition_generator/templates/cookbooks/%recipe_name%/definitions/%definition_name%.rb.tt
|
122
123
|
- lib/engineyard-recipes/generators/init_generator.rb
|
@@ -125,6 +126,8 @@ files:
|
|
125
126
|
- lib/engineyard-recipes/generators/init_generator/templates/cookbooks/main/libraries/ruby_block.rb
|
126
127
|
- lib/engineyard-recipes/generators/init_generator/templates/cookbooks/main/libraries/run_for_app.rb
|
127
128
|
- lib/engineyard-recipes/generators/init_generator/templates/cookbooks/main/recipes/default.rb
|
129
|
+
- lib/engineyard-recipes/generators/init_generator/templates/deploy/before_migrate.rb
|
130
|
+
- lib/engineyard-recipes/generators/init_generator/templates/deploy/solo.rb
|
128
131
|
- lib/engineyard-recipes/generators/init_sm_generator.rb
|
129
132
|
- lib/engineyard-recipes/generators/init_sm_generator/templates/cookbooks/sm/attributes/recipe.rb
|
130
133
|
- lib/engineyard-recipes/generators/init_sm_generator/templates/cookbooks/sm/recipes/default.rb
|
@@ -160,22 +163,28 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
160
163
|
- - ! '>='
|
161
164
|
- !ruby/object:Gem::Version
|
162
165
|
version: '0'
|
166
|
+
segments:
|
167
|
+
- 0
|
168
|
+
hash: -2456091498518849486
|
163
169
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
170
|
none: false
|
165
171
|
requirements:
|
166
172
|
- - ! '>='
|
167
173
|
- !ruby/object:Gem::Version
|
168
174
|
version: '0'
|
175
|
+
segments:
|
176
|
+
- 0
|
177
|
+
hash: -2456091498518849486
|
169
178
|
requirements: []
|
170
179
|
rubyforge_project: engineyard-recipes
|
171
|
-
rubygems_version: 1.8.
|
180
|
+
rubygems_version: 1.8.17
|
172
181
|
signing_key:
|
173
182
|
specification_version: 3
|
174
183
|
summary: Tools to generate, upload, test and apply chef recipes for Engine Yard Cloud.
|
175
184
|
test_files:
|
176
185
|
- features/clone-recipe.feature
|
177
186
|
- features/generate-helper-definitions.feature
|
178
|
-
- features/generate-recipe.feature
|
187
|
+
- features/generate-recipe-in-cookbook.feature
|
179
188
|
- features/init-new-cookbook.feature
|
180
189
|
- features/init-sm-framework.feature
|
181
190
|
- features/step_definitions/api_steps.rb
|