opsmgr 0.26.2 → 0.27.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: c72d17b05601deea9fe2e1c9aadc148de996d047
4
- data.tar.gz: d4fb57474f70e3720f14745f25efa063c846a087
3
+ metadata.gz: 92779c8cfe52a2eb604969894523bda1b3a6d8f4
4
+ data.tar.gz: c54dde7aaf031aad52268fc29cc582d04f9dfe1e
5
5
  SHA512:
6
- metadata.gz: c6c6aa009d4ff2e9f5dae4720c27cdd4bec8de0cc82c332d9126b68a6e7663a4a05b3e95d000c4d272b6dfa031aee77eb2e974db603549d66b84cc853caa3f11
7
- data.tar.gz: c2f8e6638a0117effcaf44e8b88250106285b5715b57816ee6477095bdad08b6bc51faf84952c7999fb89ea1e92e35ea6395e99191bb8b856a64db09f2e57c5e
6
+ metadata.gz: 0ddbbeda6b4db32e31e8f04e2efe4ba99de33718234b8768e514fe2177c81a3f69a1f53157f36ccb8f08ab3ce9168764c67f26b57e4ba343f6e56b4d0cd4fca0
7
+ data.tar.gz: 76585c4007685c8396d123c6ac5a6dcf2e60733b05600dbf50335042a71983f2bae8bf06be147f4952a26640dfd6a83e22f0730a5295105b4d882a38101f8608
@@ -5,15 +5,19 @@ require 'opsmgr/api/client'
5
5
 
6
6
  class ProductUploadWrapper
7
7
  def self.wrap_add(environment:, product_path:, product_name:)
8
- wrap_add_upgrade(environment, product_path, product_name, 'add')
8
+ wrap_operation(environment, product_path, product_name, 'add')
9
9
  end
10
10
 
11
11
  def self.wrap_upgrade(environment:, product_path:, product_name:)
12
- wrap_add_upgrade(environment, product_path, product_name, 'upgrade')
12
+ wrap_operation(environment, product_path, product_name, 'upgrade')
13
13
  end
14
14
 
15
- def self.wrap_add_upgrade(environment, product_path, product_name, operation)
16
- if operation != 'add' && operation != 'upgrade'
15
+ def self.wrap_upload(environment:, product_path:, product_name:)
16
+ wrap_operation(environment, product_path, product_name, 'upload')
17
+ end
18
+
19
+ def self.wrap_operation(environment, product_path, product_name, operation)
20
+ unless %w(add upgrade upload).include?(operation)
17
21
  fail "Operation '#{operation}' is not available"
18
22
  end
19
23
 
@@ -28,6 +32,8 @@ class ProductUploadWrapper
28
32
 
29
33
  fail "#{product_name} is not available" if stored_version.nil?
30
34
 
35
+ return if operation == 'upload'
36
+
31
37
  if operation == 'add'
32
38
  opsmgr_cmd.add_product(client, product_name, stored_version.to_s)
33
39
  else
@@ -1,5 +1,16 @@
1
1
  namespace :opsmgr do
2
2
  namespace :product do
3
+ desc 'Upload a Pivotal Product'
4
+ task :upload, [:environment, :_om_version, :product_path, :product_name] do |_, args|
5
+ require 'opsmgr/product_upload_wrapper'
6
+
7
+ ProductUploadWrapper.wrap_upload(
8
+ environment: args.environment,
9
+ product_path: args.product_path,
10
+ product_name: args.product_name
11
+ )
12
+ end
13
+
3
14
  desc 'Upload and Add a Pivotal Product'
4
15
  task :upload_add, [:environment, :_om_version, :product_path, :product_name] do |_, args|
5
16
  require 'opsmgr/product_upload_wrapper'
@@ -1,5 +1,5 @@
1
1
  module Opsmgr
2
- VERSION = '0.26.2'
2
+ VERSION = '0.27.0'
3
3
  end
4
4
  # Copyright (c) 2014-2015 Pivotal Software, Inc.
5
5
  # All rights reserved.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opsmgr
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.26.2
4
+ version: 0.27.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Release Engineering