cloudkeeper-one 1.2.5 → 1.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c0059a504bada828c16f48a8c1b6aec4ebf7c216
4
- data.tar.gz: 840ef3198ff3c13c7f23b5f152ce6e88571abc2a
3
+ metadata.gz: 142698a5fff9551e770ba001dad66d3ff35520d1
4
+ data.tar.gz: 8bf86665e5fb279459dc7076c8fff53dd5afb1cd
5
5
  SHA512:
6
- metadata.gz: be0fc2f879b91df31887cf5ca9924021751358ccf845ef6e76c793860d61381435128cba5c2561de5453e0f189ac50ed30ce10967b45db820d6663020edaf91f
7
- data.tar.gz: 48f4d2b9bc6dc4c843517e719ec5bc76ecfa3a435ace864099d924218cf8381616fe4b6788b6ee472cf165fff45f01308ec4a0d050a3e11b34dd969774a2019c
6
+ metadata.gz: 512eae371eb0df6f7ec7161098fe2b249596469ec8fbe329b586527a6877dbb73e64039638ca0b6751775505496268641d7c2b1b24035cfbd5c42d5e6d965939
7
+ data.tar.gz: 41028929c4f8bbb713315292d6161325a50895279f9988072d59bd3acc386a29dc0a8f03985c8ef79b106499bec71b5c4482ac3628c6bfc803982b36f922acff
data/.circleci/config.yml CHANGED
@@ -6,25 +6,28 @@ jobs:
6
6
  - /.*/
7
7
  docker:
8
8
  - image: docker:stable
9
- working_directory: /root/cloudkeeper-one
9
+ working_directory: /root/working_directory
10
10
  steps:
11
11
  - run: apk add --no-cache git openssh
12
12
  - checkout
13
13
  - setup_remote_docker
14
+ - run: |
15
+ git config --global --replace-all versionsort.prereleasesuffix ".alpha"
16
+ git config --global --add versionsort.prereleasesuffix ".beta"
14
17
  - run: |
15
18
  TAG=${CIRCLE_TAG#v}
16
19
  BRANCH=${TAG/%.*/.x}
17
20
  VERSION=${TAG}
18
- LATEST=$(git tag --sort=-refname | head -n 1)
21
+ LATEST=$(git tag --sort=-version:refname | head -n 1)
19
22
 
20
23
  docker login -u $DOCKER_USER -p $DOCKER_PASS
21
24
 
22
- docker build --build-arg branch=$BRANCH --build-arg version="$VERSION" -t cloudkeeper/cloudkeeper-one:$TAG .
23
- docker push cloudkeeper/cloudkeeper-one:$TAG
25
+ docker build --build-arg branch=$BRANCH --build-arg version="$VERSION" -t $DOCKERHUB_ORGANIZATION/$CIRCLE_PROJECT_REPONAME:$TAG ./$DOCKERFILE_DIR
26
+ docker push $DOCKERHUB_ORGANIZATION/$CIRCLE_PROJECT_REPONAME:$TAG
24
27
 
25
28
  if [ "$LATEST" == "$CIRCLE_TAG" ]; then
26
- docker tag cloudkeeper/cloudkeeper-one:$TAG cloudkeeper/cloudkeeper-one:latest
27
- docker push cloudkeeper/cloudkeeper-one:latest
29
+ docker tag $DOCKERHUB_ORGANIZATION/$CIRCLE_PROJECT_REPONAME:$TAG $DOCKERHUB_ORGANIZATION/$CIRCLE_PROJECT_REPONAME:latest
30
+ docker push $DOCKERHUB_ORGANIZATION/$CIRCLE_PROJECT_REPONAME:latest
28
31
  fi
29
32
  deployment:
30
33
  fake_deploy_for_cci2:
data/.rubocop.yml CHANGED
@@ -1,7 +1,7 @@
1
1
  require: rubocop-rspec
2
2
 
3
3
  AllCops:
4
- TargetRubyVersion: 2.0
4
+ TargetRubyVersion: 2.2
5
5
  Exclude:
6
6
  - 'vendor/**/*'
7
7
  - 'lib/cloudkeeper_grpc/*'
@@ -30,26 +30,26 @@ Gem::Specification.new do |spec|
30
30
  spec.require_paths = ['lib']
31
31
 
32
32
  spec.add_development_dependency 'bundler', '~> 1.14'
33
+ spec.add_development_dependency 'grpc-tools', '>= 1.1', '<= 1.2.5'
34
+ spec.add_development_dependency 'pry', '~> 0.10'
35
+ spec.add_development_dependency 'pry-byebug', '~> 3.4'
33
36
  spec.add_development_dependency 'rake', '~> 11.2'
34
37
  spec.add_development_dependency 'rspec', '~> 3.5'
38
+ spec.add_development_dependency 'rspec-collection_matchers', '~> 1.1'
35
39
  spec.add_development_dependency 'rubocop', '~> 0.48'
36
40
  spec.add_development_dependency 'rubocop-rspec', '~> 1.15'
37
- spec.add_development_dependency 'rspec-collection_matchers', '~> 1.1'
38
41
  spec.add_development_dependency 'simplecov', '~> 0.12'
39
- spec.add_development_dependency 'pry', '~> 0.10'
40
- spec.add_development_dependency 'pry-byebug', '~> 3.4'
41
42
  spec.add_development_dependency 'vcr', '~> 3.0'
42
43
  spec.add_development_dependency 'webmock', '~> 3.0'
43
- spec.add_development_dependency 'grpc-tools', '>= 1.1', '<= 1.2.5'
44
44
 
45
- spec.add_runtime_dependency 'thor', '~> 0.19'
46
- spec.add_runtime_dependency 'yell', '~> 2.0'
47
- spec.add_runtime_dependency 'grpc', '>= 1.1', '<= 1.2.5'
48
- spec.add_runtime_dependency 'settingslogic', '~> 2.0'
49
45
  spec.add_runtime_dependency 'activesupport', '>= 4.0', '< 6.0'
50
- spec.add_runtime_dependency 'tilt', '~> 2.0'
51
- spec.add_runtime_dependency 'opennebula', '~> 5.2'
52
46
  spec.add_runtime_dependency 'chronic_duration', '~> 0.10'
47
+ spec.add_runtime_dependency 'grpc', '~> 1.8'
48
+ spec.add_runtime_dependency 'opennebula', '~> 5.2'
49
+ spec.add_runtime_dependency 'settingslogic', '~> 2.0'
50
+ spec.add_runtime_dependency 'thor', '~> 0.19'
51
+ spec.add_runtime_dependency 'tilt', '~> 2.0'
52
+ spec.add_runtime_dependency 'yell', '~> 2.0'
53
53
 
54
54
  spec.required_ruby_version = '>= 2.2.0'
55
55
  end
@@ -23,8 +23,8 @@ module Cloudkeeper
23
23
  templates.uniq! { |template| template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_ID}"] }
24
24
 
25
25
  appliances = templates.map do |template|
26
- image = find_image_for_template template
27
- populate_proto_appliance template, image
26
+ check_image_for_template! template
27
+ populate_proto_appliance template
28
28
  end
29
29
 
30
30
  logger.debug "Appliances: #{appliances.map(&:identifier).inspect}"
@@ -33,14 +33,12 @@ module Cloudkeeper
33
33
 
34
34
  private
35
35
 
36
- def find_image_for_template(template)
37
- image = image_handler.find_by_name template.name
36
+ def check_image_for_template!(template)
38
37
  raise Cloudkeeper::One::Errors::Actions::ListingError, "Missing coresponding image for template #{template.id.inspect}" \
39
- unless image
40
- image
38
+ unless image_handler.find_by_name template.name
41
39
  end
42
40
 
43
- def populate_proto_appliance(template, image)
41
+ def populate_proto_appliance(template)
44
42
  CloudkeeperGrpc::Appliance.new identifier: template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_ID}"].to_s,
45
43
  description: template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_DESCRIPTION}"].to_s,
46
44
  mpuri: template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_MPURI}"].to_s,
@@ -52,19 +50,11 @@ module Cloudkeeper
52
50
  architecture: template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_ARCHITECTURE}"].to_s,
53
51
  operating_system: template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_OPERATING_SYSTEM}"].to_s,
54
52
  vo: template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_VO}"].to_s,
55
- image: populate_proto_image(image),
53
+ image: nil,
56
54
  expiration_date: template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_EXPIRATION_DATE}"].to_i,
57
55
  image_list_identifier: template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_IMAGE_LIST_ID}"].to_s,
58
56
  attributes: JSON.parse(Base64.strict_decode64(template["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::APPLIANCE_ATTRIBUTES}"]))
59
57
  end
60
-
61
- def populate_proto_image(image)
62
- CloudkeeperGrpc::Image.new mode: :LOCAL, location: '',
63
- format: image["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::IMAGE_FORMAT}"].upcase.to_sym,
64
- checksum: image["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::IMAGE_CHECKSUM}"].to_s,
65
- size: image["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::IMAGE_SIZE}"].to_i,
66
- uri: image["TEMPLATE/#{Cloudkeeper::One::Opennebula::Tags::IMAGE_URI}"].to_s
67
- end
68
58
  end
69
59
  end
70
60
  end
@@ -13,11 +13,4 @@
13
13
  <%= Cloudkeeper::One::Opennebula::Tags::APPLIANCE_EXPIRATION_DATE %> = "<%= appliance.expiration_date %>"
14
14
  <%= Cloudkeeper::One::Opennebula::Tags::APPLIANCE_IMAGE_LIST_ID %> = "<%= appliance.image_list_identifier %>"
15
15
 
16
- <% if image %>
17
- <%= Cloudkeeper::One::Opennebula::Tags::IMAGE_URI %> = "<%= image.uri %>"
18
- <%= Cloudkeeper::One::Opennebula::Tags::IMAGE_CHECKSUM %> = "<%= image.checksum %>"
19
- <%= Cloudkeeper::One::Opennebula::Tags::IMAGE_SIZE %> = "<%= image.size %>"
20
- <%= Cloudkeeper::One::Opennebula::Tags::IMAGE_FORMAT %> = "<%= image.format %>"
21
- <% end %>
22
-
23
16
  <%= Cloudkeeper::One::Opennebula::Tags::APPLIANCE_ATTRIBUTES %> = "<%= Base64.strict_encode64 appliance.attributes.to_h.to_json %>"
@@ -97,9 +97,8 @@ module Cloudkeeper
97
97
  end
98
98
 
99
99
  def finalize_return_value(return_value, default_return_value, use_return_value)
100
- return_value = use_return_value ? return_value : default_return_value
101
-
102
- return_value
100
+ return return_value if return_value && use_return_value
101
+ default_return_value
103
102
  end
104
103
  end
105
104
  end
@@ -1,5 +1,5 @@
1
1
  module Cloudkeeper
2
2
  module One
3
- VERSION = '1.2.5'.freeze
3
+ VERSION = '1.3.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloudkeeper-one
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.5
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michal Kimle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-21 00:00:00.000000000 Z
11
+ date: 2017-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -25,61 +25,81 @@ dependencies:
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.14'
27
27
  - !ruby/object:Gem::Dependency
28
- name: rake
28
+ name: grpc-tools
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ - - "<="
35
+ - !ruby/object:Gem::Version
36
+ version: 1.2.5
37
+ type: :development
38
+ prerelease: false
39
+ version_requirements: !ruby/object:Gem::Requirement
40
+ requirements:
41
+ - - ">="
42
+ - !ruby/object:Gem::Version
43
+ version: '1.1'
44
+ - - "<="
45
+ - !ruby/object:Gem::Version
46
+ version: 1.2.5
47
+ - !ruby/object:Gem::Dependency
48
+ name: pry
29
49
  requirement: !ruby/object:Gem::Requirement
30
50
  requirements:
31
51
  - - "~>"
32
52
  - !ruby/object:Gem::Version
33
- version: '11.2'
53
+ version: '0.10'
34
54
  type: :development
35
55
  prerelease: false
36
56
  version_requirements: !ruby/object:Gem::Requirement
37
57
  requirements:
38
58
  - - "~>"
39
59
  - !ruby/object:Gem::Version
40
- version: '11.2'
60
+ version: '0.10'
41
61
  - !ruby/object:Gem::Dependency
42
- name: rspec
62
+ name: pry-byebug
43
63
  requirement: !ruby/object:Gem::Requirement
44
64
  requirements:
45
65
  - - "~>"
46
66
  - !ruby/object:Gem::Version
47
- version: '3.5'
67
+ version: '3.4'
48
68
  type: :development
49
69
  prerelease: false
50
70
  version_requirements: !ruby/object:Gem::Requirement
51
71
  requirements:
52
72
  - - "~>"
53
73
  - !ruby/object:Gem::Version
54
- version: '3.5'
74
+ version: '3.4'
55
75
  - !ruby/object:Gem::Dependency
56
- name: rubocop
76
+ name: rake
57
77
  requirement: !ruby/object:Gem::Requirement
58
78
  requirements:
59
79
  - - "~>"
60
80
  - !ruby/object:Gem::Version
61
- version: '0.48'
81
+ version: '11.2'
62
82
  type: :development
63
83
  prerelease: false
64
84
  version_requirements: !ruby/object:Gem::Requirement
65
85
  requirements:
66
86
  - - "~>"
67
87
  - !ruby/object:Gem::Version
68
- version: '0.48'
88
+ version: '11.2'
69
89
  - !ruby/object:Gem::Dependency
70
- name: rubocop-rspec
90
+ name: rspec
71
91
  requirement: !ruby/object:Gem::Requirement
72
92
  requirements:
73
93
  - - "~>"
74
94
  - !ruby/object:Gem::Version
75
- version: '1.15'
95
+ version: '3.5'
76
96
  type: :development
77
97
  prerelease: false
78
98
  version_requirements: !ruby/object:Gem::Requirement
79
99
  requirements:
80
100
  - - "~>"
81
101
  - !ruby/object:Gem::Version
82
- version: '1.15'
102
+ version: '3.5'
83
103
  - !ruby/object:Gem::Dependency
84
104
  name: rspec-collection_matchers
85
105
  requirement: !ruby/object:Gem::Requirement
@@ -95,47 +115,47 @@ dependencies:
95
115
  - !ruby/object:Gem::Version
96
116
  version: '1.1'
97
117
  - !ruby/object:Gem::Dependency
98
- name: simplecov
118
+ name: rubocop
99
119
  requirement: !ruby/object:Gem::Requirement
100
120
  requirements:
101
121
  - - "~>"
102
122
  - !ruby/object:Gem::Version
103
- version: '0.12'
123
+ version: '0.48'
104
124
  type: :development
105
125
  prerelease: false
106
126
  version_requirements: !ruby/object:Gem::Requirement
107
127
  requirements:
108
128
  - - "~>"
109
129
  - !ruby/object:Gem::Version
110
- version: '0.12'
130
+ version: '0.48'
111
131
  - !ruby/object:Gem::Dependency
112
- name: pry
132
+ name: rubocop-rspec
113
133
  requirement: !ruby/object:Gem::Requirement
114
134
  requirements:
115
135
  - - "~>"
116
136
  - !ruby/object:Gem::Version
117
- version: '0.10'
137
+ version: '1.15'
118
138
  type: :development
119
139
  prerelease: false
120
140
  version_requirements: !ruby/object:Gem::Requirement
121
141
  requirements:
122
142
  - - "~>"
123
143
  - !ruby/object:Gem::Version
124
- version: '0.10'
144
+ version: '1.15'
125
145
  - !ruby/object:Gem::Dependency
126
- name: pry-byebug
146
+ name: simplecov
127
147
  requirement: !ruby/object:Gem::Requirement
128
148
  requirements:
129
149
  - - "~>"
130
150
  - !ruby/object:Gem::Version
131
- version: '3.4'
151
+ version: '0.12'
132
152
  type: :development
133
153
  prerelease: false
134
154
  version_requirements: !ruby/object:Gem::Requirement
135
155
  requirements:
136
156
  - - "~>"
137
157
  - !ruby/object:Gem::Version
138
- version: '3.4'
158
+ version: '0.12'
139
159
  - !ruby/object:Gem::Dependency
140
160
  name: vcr
141
161
  requirement: !ruby/object:Gem::Requirement
@@ -165,73 +185,67 @@ dependencies:
165
185
  - !ruby/object:Gem::Version
166
186
  version: '3.0'
167
187
  - !ruby/object:Gem::Dependency
168
- name: grpc-tools
188
+ name: activesupport
169
189
  requirement: !ruby/object:Gem::Requirement
170
190
  requirements:
171
191
  - - ">="
172
192
  - !ruby/object:Gem::Version
173
- version: '1.1'
174
- - - "<="
193
+ version: '4.0'
194
+ - - "<"
175
195
  - !ruby/object:Gem::Version
176
- version: 1.2.5
177
- type: :development
196
+ version: '6.0'
197
+ type: :runtime
178
198
  prerelease: false
179
199
  version_requirements: !ruby/object:Gem::Requirement
180
200
  requirements:
181
201
  - - ">="
182
202
  - !ruby/object:Gem::Version
183
- version: '1.1'
184
- - - "<="
203
+ version: '4.0'
204
+ - - "<"
185
205
  - !ruby/object:Gem::Version
186
- version: 1.2.5
206
+ version: '6.0'
187
207
  - !ruby/object:Gem::Dependency
188
- name: thor
208
+ name: chronic_duration
189
209
  requirement: !ruby/object:Gem::Requirement
190
210
  requirements:
191
211
  - - "~>"
192
212
  - !ruby/object:Gem::Version
193
- version: '0.19'
213
+ version: '0.10'
194
214
  type: :runtime
195
215
  prerelease: false
196
216
  version_requirements: !ruby/object:Gem::Requirement
197
217
  requirements:
198
218
  - - "~>"
199
219
  - !ruby/object:Gem::Version
200
- version: '0.19'
220
+ version: '0.10'
201
221
  - !ruby/object:Gem::Dependency
202
- name: yell
222
+ name: grpc
203
223
  requirement: !ruby/object:Gem::Requirement
204
224
  requirements:
205
225
  - - "~>"
206
226
  - !ruby/object:Gem::Version
207
- version: '2.0'
227
+ version: '1.8'
208
228
  type: :runtime
209
229
  prerelease: false
210
230
  version_requirements: !ruby/object:Gem::Requirement
211
231
  requirements:
212
232
  - - "~>"
213
233
  - !ruby/object:Gem::Version
214
- version: '2.0'
234
+ version: '1.8'
215
235
  - !ruby/object:Gem::Dependency
216
- name: grpc
236
+ name: opennebula
217
237
  requirement: !ruby/object:Gem::Requirement
218
238
  requirements:
219
- - - ">="
220
- - !ruby/object:Gem::Version
221
- version: '1.1'
222
- - - "<="
239
+ - - "~>"
223
240
  - !ruby/object:Gem::Version
224
- version: 1.2.5
241
+ version: '5.2'
225
242
  type: :runtime
226
243
  prerelease: false
227
244
  version_requirements: !ruby/object:Gem::Requirement
228
245
  requirements:
229
- - - ">="
230
- - !ruby/object:Gem::Version
231
- version: '1.1'
232
- - - "<="
246
+ - - "~>"
233
247
  - !ruby/object:Gem::Version
234
- version: 1.2.5
248
+ version: '5.2'
235
249
  - !ruby/object:Gem::Dependency
236
250
  name: settingslogic
237
251
  requirement: !ruby/object:Gem::Requirement
@@ -247,25 +261,19 @@ dependencies:
247
261
  - !ruby/object:Gem::Version
248
262
  version: '2.0'
249
263
  - !ruby/object:Gem::Dependency
250
- name: activesupport
264
+ name: thor
251
265
  requirement: !ruby/object:Gem::Requirement
252
266
  requirements:
253
- - - ">="
254
- - !ruby/object:Gem::Version
255
- version: '4.0'
256
- - - "<"
267
+ - - "~>"
257
268
  - !ruby/object:Gem::Version
258
- version: '6.0'
269
+ version: '0.19'
259
270
  type: :runtime
260
271
  prerelease: false
261
272
  version_requirements: !ruby/object:Gem::Requirement
262
273
  requirements:
263
- - - ">="
264
- - !ruby/object:Gem::Version
265
- version: '4.0'
266
- - - "<"
274
+ - - "~>"
267
275
  - !ruby/object:Gem::Version
268
- version: '6.0'
276
+ version: '0.19'
269
277
  - !ruby/object:Gem::Dependency
270
278
  name: tilt
271
279
  requirement: !ruby/object:Gem::Requirement
@@ -281,33 +289,19 @@ dependencies:
281
289
  - !ruby/object:Gem::Version
282
290
  version: '2.0'
283
291
  - !ruby/object:Gem::Dependency
284
- name: opennebula
285
- requirement: !ruby/object:Gem::Requirement
286
- requirements:
287
- - - "~>"
288
- - !ruby/object:Gem::Version
289
- version: '5.2'
290
- type: :runtime
291
- prerelease: false
292
- version_requirements: !ruby/object:Gem::Requirement
293
- requirements:
294
- - - "~>"
295
- - !ruby/object:Gem::Version
296
- version: '5.2'
297
- - !ruby/object:Gem::Dependency
298
- name: chronic_duration
292
+ name: yell
299
293
  requirement: !ruby/object:Gem::Requirement
300
294
  requirements:
301
295
  - - "~>"
302
296
  - !ruby/object:Gem::Version
303
- version: '0.10'
297
+ version: '2.0'
304
298
  type: :runtime
305
299
  prerelease: false
306
300
  version_requirements: !ruby/object:Gem::Requirement
307
301
  requirements:
308
302
  - - "~>"
309
303
  - !ruby/object:Gem::Version
310
- version: '0.10'
304
+ version: '2.0'
311
305
  description: OpenNebula backend for cloudkeeper
312
306
  email:
313
307
  - kimle.michal@gmail.com
@@ -414,7 +408,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
414
408
  version: '0'
415
409
  requirements: []
416
410
  rubyforge_project:
417
- rubygems_version: 2.6.13
411
+ rubygems_version: 2.6.14
418
412
  signing_key:
419
413
  specification_version: 4
420
414
  summary: OpenNebula backend for cloudkeeper