dployr 0.0.9 → 0.0.10

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ccf10af60294e8d7c5e2edbe34f4bc1b2c2c3ea4
4
- data.tar.gz: d1d72ea9459501658813c121fb4c3f05450d3d29
3
+ metadata.gz: 5c5a14e300cb3831bedf130b3a12975e13fbbad8
4
+ data.tar.gz: 29fa5cbb80af3b030fd181f5231cbb062f85290e
5
5
  SHA512:
6
- metadata.gz: 89d38a44d6797a60ae5e8593ca958244648dbeff3e33926c2e6e5f689626e05ea2b59f6a0922e26fd83ae1aeb3f73eec6a397b38e0098ab5cf38ed9a8d1c9284
7
- data.tar.gz: 6ee5b85aef80f2a1c915ea3195139e9312bdcca676721ae37c843c578a452a8fd6d6b9777e6058bf9a789af6b49ebe4311cb2100d75009b17ccc24ef65cd7560
6
+ metadata.gz: 65d4d90a2364345c3c259062413ef105330ca17830480c56d95347be455011133d067ee8467f67e4dcd93c46dee524a5bb03ca8b7b0ceaa18566489620dd96fc
7
+ data.tar.gz: 0376ef3eda087804224485fbdbcab63fbe78fa88d5320058b9a017a405926fbafcf43af9bb1713a0fe3c414ab445e4c335d8b73baa8f19f508d7fb27fcf64122
data/README.md CHANGED
@@ -1,7 +1,5 @@
1
1
  # dployr [![Build Status](https://secure.travis-ci.org/innotech/dployr.svg?branch=master)][travis] [![Dependency Status](https://gemnasium.com/innotech/dployr.svg)][gemnasium] [![Gem](https://badge.fury.io/rb/dployr.svg)][gem]
2
2
 
3
- > Multicloud management and deployment made simple
4
-
5
3
  > **Alpha project, use it by your own risk**
6
4
 
7
5
  <table>
@@ -19,10 +17,10 @@
19
17
  and deployment** across different providers
20
18
 
21
19
  You can setup all your project cloud infraestructure from a
22
- simple configuration file and deploy it into multiple clouds easily
20
+ simple [configuration file](#configuration) and deploy it into multiple clouds easily
23
21
 
24
22
  Through Dployr you can take full control about the multiple stages phases
25
- which covers the full deployment infrastructure workflow,
23
+ which covers the complete infrastructure workflow,
26
24
  such as instances creation, network configuration, provisioning, testing and halting
27
25
 
28
26
  It provides a featured [command-line interface](#command-line-interface) and [programmatic API](#programmatic-api)
data/dployr.gemspec CHANGED
@@ -4,8 +4,8 @@ require 'dployr/version'
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "dployr"
6
6
  s.version = Dployr::VERSION
7
- s.summary = "Multicloud management and deployment with asteroids made simple"
8
- s.description = "Multicloud management and deployment with asteroids made simple with a rich programmatic API and featured CLI"
7
+ s.summary = "Multicloud management and deployment made simple"
8
+ s.description = "Multicloud management and deployment made simple from a single configuration file with a featured CLI and programmatic API, supporting deployment stages, local scripts and remote scripts execution and more"
9
9
  s.authors = ["Tomas Aparicio", "German Ramos"]
10
10
  s.email = ["nerds@innotechapp.com"]
11
11
  s.homepage = "https://github.com/innotech/dployr"
@@ -39,17 +39,15 @@ module Dployr
39
39
  end
40
40
  end
41
41
 
42
- def get_region_config(options)
43
- @dployr.config.get_region options[:name], options[:provider], options[:region]
44
- end
45
-
46
- private
47
-
48
42
  def get_config
49
43
  @config = get_region_config @options
50
44
  @p_attrs = @config[:attributes]
51
45
  end
52
46
 
47
+ def get_region_config(options)
48
+ @dployr.config.get_region options[:name], options[:provider], options[:region]
49
+ end
50
+
53
51
  end
54
52
  end
55
53
  end
@@ -125,6 +125,26 @@ module Dployr
125
125
  attrs
126
126
  end
127
127
 
128
+ # Pending refactor
129
+ def get_inherited_attributes(config, provider, region)
130
+ config = merge_defaults(config)
131
+ attrs = config[:attributes].is_a?(Hash) ? deep_copy(config[:attributes]) : {}
132
+
133
+ if current = get_by_key(config, :providers)
134
+ attrs.merge! current[:attributes] if current[:attributes].is_a? Hash
135
+ if current = get_by_key(current, provider)
136
+ attrs.merge! get_by_key(current, :attributes) if get_by_key(current, :attributes).is_a? Hash
137
+ if (regions = get_by_key current, :regions).is_a? Hash
138
+ attrs.merge! get_by_key(regions, :attributes) if get_by_key(regions, :attributes).is_a? Hash
139
+ if (region = get_by_key regions, region).is_a? Hash
140
+ attrs.merge! get_by_key(region, :attributes) if get_by_key(region, :attributes).is_a? Hash
141
+ end
142
+ end
143
+ end
144
+ end
145
+ attrs
146
+ end
147
+
128
148
  def merge_config(instance, attributes = {})
129
149
  config = merge_defaults instance.get_values
130
150
  config[:attributes] =
@@ -140,11 +160,13 @@ module Dployr
140
160
  def merge_providers(config)
141
161
  key = get_real_key config, :providers
142
162
  if config[key].is_a? Hash
143
- config[key].each do |name, provider|
144
- provider = replace_keywords 'provider', name, inherit_config(provider, config)
163
+ config[key].each do |provider_name, provider|
164
+ provider = replace_keywords 'provider', provider_name, inherit_config(provider, config)
145
165
  regions = get_by_key provider, get_real_key(provider, :regions)
146
166
  regions.each do |name, region|
147
167
  regions[name] = replace_keywords 'region', name, inherit_config(region, provider)
168
+ attrs = get_inherited_attributes config, provider_name, name
169
+ regions[name] = replace_variables regions[name], attrs
148
170
  end if regions
149
171
  end
150
172
  end
data/lib/dployr/init.rb CHANGED
@@ -43,11 +43,12 @@ module Dployr
43
43
  end
44
44
 
45
45
  def load_config(file_path = nil)
46
- if file_path
47
- @file_path = file_path
48
- else
49
- @file_path = discover
50
- end
46
+ @file_path =
47
+ if file_path
48
+ file_path
49
+ else
50
+ discover
51
+ end
51
52
  set_config @file_path
52
53
  end
53
54
 
@@ -67,7 +68,7 @@ module Dployr
67
68
  config = read_yaml file_path
68
69
  if config.is_a? Hash
69
70
  config.each do |name, config|
70
- if name == 'default'
71
+ if name.to_s == 'default'
71
72
  @config.set_default config
72
73
  else
73
74
  @config.add_instance name, config
@@ -1,3 +1,3 @@
1
1
  module Dployr
2
- VERSION = '0.0.9'
2
+ VERSION = '0.0.10'
3
3
  end
@@ -18,7 +18,9 @@ describe Dployr::Configuration do
18
18
  attributes: {
19
19
  name: "example",
20
20
  instance_type: "m1.small",
21
- version: "${DPLOYR}"
21
+ version: "${DPLOYR}",
22
+ network_id: "be457fca",
23
+ mixed: "%{network_id}-%{instance_type}"
22
24
  },
23
25
  scripts: [
24
26
  { path: "configure.sh" }
@@ -28,8 +30,7 @@ describe Dployr::Configuration do
28
30
  attributes: {
29
31
  network_id: "be457fca",
30
32
  instance_type: "m1.small",
31
- "type-%{name}" => "small",
32
- mixed: "%{network_id}-%{instance_type}"
33
+ "type-%{name}" => "small"
33
34
  },
34
35
  scripts: [
35
36
  {
@@ -60,7 +61,7 @@ describe Dployr::Configuration do
60
61
 
61
62
  it "should have valid attributes" do
62
63
  config.default.attributes.should be_a Hash
63
- config.default.attributes.should have(3).items
64
+ config.default.attributes.should have(5).items
64
65
  end
65
66
 
66
67
  it "should have scripts" do
@@ -225,7 +226,7 @@ describe Dployr::Configuration do
225
226
  }
226
227
 
227
228
  it "should have a valid number of attributes" do
228
- gce[:attributes].should have(3).items
229
+ gce[:attributes].should have(5).items
229
230
  end
230
231
 
231
232
  it "should have the instance_type attributes" do
@@ -246,7 +247,7 @@ describe Dployr::Configuration do
246
247
  }
247
248
 
248
249
  it "should have a valid number of attributes" do
249
- region[:attributes].should have(4).items
250
+ region[:attributes].should have(6).items
250
251
  end
251
252
 
252
253
  it "should have inherited scripts" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dployr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomas Aparicio
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-09 00:00:00.000000000 Z
12
+ date: 2014-05-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fog
@@ -109,8 +109,9 @@ dependencies:
109
109
  - - ~>
110
110
  - !ruby/object:Gem::Version
111
111
  version: '2'
112
- description: Multicloud management and deployment with asteroids made simple with
113
- a rich programmatic API and featured CLI
112
+ description: Multicloud management and deployment made simple from a single configuration
113
+ file with a featured CLI and programmatic API, supporting deployment stages, local
114
+ scripts and remote scripts execution and more
114
115
  email:
115
116
  - nerds@innotechapp.com
116
117
  executables:
@@ -198,7 +199,7 @@ rubyforge_project: dployr
198
199
  rubygems_version: 2.0.6
199
200
  signing_key:
200
201
  specification_version: 4
201
- summary: Multicloud management and deployment with asteroids made simple
202
+ summary: Multicloud management and deployment made simple
202
203
  test_files:
203
204
  - spec/commands_config_spec.rb
204
205
  - spec/commands_util_spec.rb