gaptool-client 0.5.6 → 0.5.7

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 89195581829ed0086d7056f395ce27bce1b57de9
4
- data.tar.gz: 77eb3a65ebdaf3ed3161130ab4d94d794e37827f
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MmVmMjliZGEyNmIxYmE0NmIyYmNmMWMyMDQ3YTU3ZmQ4NDhiNWI1ZQ==
5
+ data.tar.gz: !binary |-
6
+ ZmUyZDQ5NGYwYWFmMjI0YjQ5YmMyYWE4OWIxZWVhZGU5NGMwMDYyNg==
5
7
  SHA512:
6
- metadata.gz: d74a99fe6ce683b17b90beb9389dc2ac74faff3465158d91676f47a875d1ca789015140ac1aef4ebc7d9b98c58da0e7af295d9bdb849388662f13793fdad9b67
7
- data.tar.gz: 1daf6c0f8ee2a9f695d196f4f1a9e5ac4cc45742a2690dfc9e4e4e94694a0ead03a0adc93f408fed63a14c3e6710701274f37300f96575514d2814c4aefcaaaf
8
+ metadata.gz: !binary |-
9
+ ZmU4OGQ3NzQwNmVkOGY2M2ZiZGIzODNkMTdlMmIyZjkxYWYxYjY3ZjlkMjQ0
10
+ NWZjYTM2OGVkOWE0Y2JhOGRhOGYyNzg5YjkwMDNmNzIzN2MzY2ViZmVjZGFm
11
+ ODQyYmEzMDQ1MzI2OGEwNGU2OWIyMzI4MDY0YzNlMTkyNzdjZDY=
12
+ data.tar.gz: !binary |-
13
+ MGM1OTk5MDExZWU3OTJlZmZjNzQyZmQ2YzlmZDgzYWYwMjI5YTRiMTU4ZThi
14
+ OTNkZDAyYmFlNzAzMzhjYTYxNDE0OWZhYWNhYjRhMzFlMDM5MmE3MzFhZDZk
15
+ MzUzNTk5ZGRjODM3MDc2YWE2MWEzZjI4MWExZjVjMDI4YzI0YTk=
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.6
1
+ 0.5.7
@@ -8,7 +8,7 @@ $:.push File.expand_path("../lib", __FILE__)
8
8
 
9
9
  Gem::Specification.new do |s|
10
10
  s.name = "gaptool-client"
11
- s.version = "0.5.6"
11
+ s.version = `awk '{printf "%s",$0}' VERSION`
12
12
  s.authors = ["Francesco Laurita", "Matt Bailey"]
13
13
  s.email = ["francesco@gild.com"]
14
14
  s.homepage = "http://www.gild.com"
@@ -74,6 +74,25 @@ def sshcmd(node, commands)
74
74
  end
75
75
  end
76
76
 
77
+ def split_attrs(attribute_list)
78
+ opts = {}
79
+ attribute_list.each do |attr_|
80
+ key, value = attr_.split('=', 2)
81
+ split = key.split('.')
82
+ cur = opts
83
+ split.each_with_index do |part, idx|
84
+ if idx == split.size - 1
85
+ # leaf, add the value
86
+ cur[part] = value
87
+ else
88
+ cur[part] ||= {}
89
+ end
90
+ cur = cur[part]
91
+ end
92
+ end
93
+ opts
94
+ end
95
+
77
96
  module Gaptool
78
97
  class InitCommand < Clamp::Command
79
98
  option ["-r", "--role"], "ROLE", "Resource name to initilize", :required => true
@@ -187,8 +206,10 @@ module Gaptool
187
206
  option ["-r", "--role"], "ROLE", "Role name to ssh to", :required => true
188
207
  option ["-e", "--environment"], "ENVIRONMENT", "Which environment, e.g. production", :required => true
189
208
  option ["-i", "--instance"], "INSTANCE", "Instance ID, e.g. i-12345678", :required => false
209
+ option ["-A", "--attribute"], "ATTRIBUTE", "Pass one or more parameters to the deploy recipe in recipe.attr=value format", :multivalued => true
190
210
 
191
211
  def execute
212
+ attrs = split_attrs(attribute_list)
192
213
  if !instance.nil?
193
214
  nodes = [$api.getonenode(instance)]
194
215
  else
@@ -206,7 +227,7 @@ module Gaptool
206
227
  'zone' => node['zone'],
207
228
  'itype' => node['itype'],
208
229
  'apps' => eval(node['apps'])
209
- }.to_json
230
+ }.merge(attrs).to_json
210
231
  commands = [
211
232
  "cd ~admin/ops; git pull",
212
233
  "echo '#{json}' > ~admin/solo.json",
@@ -224,8 +245,10 @@ module Gaptool
224
245
  option ["-b", "--branch"], "BRANCH", "Git branch to deploy, default is master", :required => false
225
246
  option ["-r", "--rollback"], :flag, "Toggle this to rollback last deploy"
226
247
  option ["-i", "--instance"], "INSTANCE", "Instance ID, e.g. i-12345678", :required => false
248
+ option ["-A", "--attribute"], "ATTRIBUTE", "Pass one or more parameters to the deploy recipe in recipe.attr=value format", :multivalued => true
227
249
 
228
250
  def execute
251
+ attrs = split_attrs(attribute_list)
229
252
  if instance
230
253
  nodes = [$api.getonenode(instance)]
231
254
  else
@@ -248,7 +271,7 @@ module Gaptool
248
271
  'rollback' => rollback?,
249
272
  'branch' => branch || 'master',
250
273
  'migrate' => migrate?
251
- }.to_json
274
+ }.merge(attrs).to_json
252
275
  commands = [
253
276
  "cd ~admin/ops; git pull",
254
277
  "echo '#{json}' > ~admin/solo.json",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gaptool-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Francesco Laurita
@@ -15,84 +15,84 @@ dependencies:
15
15
  name: json
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - "~>"
18
+ - - ~>
19
19
  - !ruby/object:Gem::Version
20
20
  version: '1.8'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - "~>"
25
+ - - ~>
26
26
  - !ruby/object:Gem::Version
27
27
  version: '1.8'
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: peach
30
30
  requirement: !ruby/object:Gem::Requirement
31
31
  requirements:
32
- - - "~>"
32
+ - - ~>
33
33
  - !ruby/object:Gem::Version
34
34
  version: '0.5'
35
35
  type: :runtime
36
36
  prerelease: false
37
37
  version_requirements: !ruby/object:Gem::Requirement
38
38
  requirements:
39
- - - "~>"
39
+ - - ~>
40
40
  - !ruby/object:Gem::Version
41
41
  version: '0.5'
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: rainbow
44
44
  requirement: !ruby/object:Gem::Requirement
45
45
  requirements:
46
- - - "~>"
46
+ - - ~>
47
47
  - !ruby/object:Gem::Version
48
48
  version: '2.0'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
- - - "~>"
53
+ - - ~>
54
54
  - !ruby/object:Gem::Version
55
55
  version: '2.0'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: clamp
58
58
  requirement: !ruby/object:Gem::Requirement
59
59
  requirements:
60
- - - "~>"
60
+ - - ~>
61
61
  - !ruby/object:Gem::Version
62
62
  version: '0.6'
63
63
  type: :runtime
64
64
  prerelease: false
65
65
  version_requirements: !ruby/object:Gem::Requirement
66
66
  requirements:
67
- - - "~>"
67
+ - - ~>
68
68
  - !ruby/object:Gem::Version
69
69
  version: '0.6'
70
70
  - !ruby/object:Gem::Dependency
71
71
  name: net-ssh
72
72
  requirement: !ruby/object:Gem::Requirement
73
73
  requirements:
74
- - - "~>"
74
+ - - ~>
75
75
  - !ruby/object:Gem::Version
76
76
  version: '2.9'
77
77
  type: :runtime
78
78
  prerelease: false
79
79
  version_requirements: !ruby/object:Gem::Requirement
80
80
  requirements:
81
- - - "~>"
81
+ - - ~>
82
82
  - !ruby/object:Gem::Version
83
83
  version: '2.9'
84
84
  - !ruby/object:Gem::Dependency
85
85
  name: net-scp
86
86
  requirement: !ruby/object:Gem::Requirement
87
87
  requirements:
88
- - - "~>"
88
+ - - ~>
89
89
  - !ruby/object:Gem::Version
90
90
  version: '1.2'
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
- - - "~>"
95
+ - - ~>
96
96
  - !ruby/object:Gem::Version
97
97
  version: '1.2'
98
98
  - !ruby/object:Gem::Dependency
@@ -113,73 +113,73 @@ dependencies:
113
113
  name: builder
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
- - - "~>"
116
+ - - ~>
117
117
  - !ruby/object:Gem::Version
118
118
  version: '3'
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
- - - "~>"
123
+ - - ~>
124
124
  - !ruby/object:Gem::Version
125
125
  version: '3'
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: shoulda
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
- - - "~>"
130
+ - - ~>
131
131
  - !ruby/object:Gem::Version
132
132
  version: '3'
133
133
  type: :development
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
- - - "~>"
137
+ - - ~>
138
138
  - !ruby/object:Gem::Version
139
139
  version: '3'
140
140
  - !ruby/object:Gem::Dependency
141
141
  name: rdoc
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
- - - "~>"
144
+ - - ~>
145
145
  - !ruby/object:Gem::Version
146
146
  version: '3'
147
147
  type: :development
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
- - - "~>"
151
+ - - ~>
152
152
  - !ruby/object:Gem::Version
153
153
  version: '3'
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: bundler
156
156
  requirement: !ruby/object:Gem::Requirement
157
157
  requirements:
158
- - - "~>"
158
+ - - ~>
159
159
  - !ruby/object:Gem::Version
160
160
  version: '1'
161
161
  type: :development
162
162
  prerelease: false
163
163
  version_requirements: !ruby/object:Gem::Requirement
164
164
  requirements:
165
- - - "~>"
165
+ - - ~>
166
166
  - !ruby/object:Gem::Version
167
167
  version: '1'
168
168
  - !ruby/object:Gem::Dependency
169
169
  name: simplecov
170
170
  requirement: !ruby/object:Gem::Requirement
171
171
  requirements:
172
- - - "~>"
172
+ - - ~>
173
173
  - !ruby/object:Gem::Version
174
174
  version: '0'
175
175
  type: :development
176
176
  prerelease: false
177
177
  version_requirements: !ruby/object:Gem::Requirement
178
178
  requirements:
179
- - - "~>"
179
+ - - ~>
180
180
  - !ruby/object:Gem::Version
181
181
  version: '0'
182
- description: "\n gaptool client\n "
182
+ description: ! "\n gaptool client\n "
183
183
  email:
184
184
  - francesco@gild.com
185
185
  executables:
@@ -187,8 +187,8 @@ executables:
187
187
  extensions: []
188
188
  extra_rdoc_files: []
189
189
  files:
190
- - ".document"
191
- - ".gitignore"
190
+ - .document
191
+ - .gitignore
192
192
  - Gemfile
193
193
  - LICENSE.txt
194
194
  - README.md
@@ -209,12 +209,12 @@ require_paths:
209
209
  - lib
210
210
  required_ruby_version: !ruby/object:Gem::Requirement
211
211
  requirements:
212
- - - ">="
212
+ - - ! '>='
213
213
  - !ruby/object:Gem::Version
214
214
  version: '0'
215
215
  required_rubygems_version: !ruby/object:Gem::Requirement
216
216
  requirements:
217
- - - ">="
217
+ - - ! '>='
218
218
  - !ruby/object:Gem::Version
219
219
  version: '0'
220
220
  requirements: []