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 +4 -4
- data/lib/opsmgr/product_upload_wrapper.rb +10 -4
- data/lib/opsmgr/tasks/product.rake +11 -0
- data/lib/opsmgr/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92779c8cfe52a2eb604969894523bda1b3a6d8f4
|
4
|
+
data.tar.gz: c54dde7aaf031aad52268fc29cc582d04f9dfe1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
12
|
+
wrap_operation(environment, product_path, product_name, 'upgrade')
|
13
13
|
end
|
14
14
|
|
15
|
-
def self.
|
16
|
-
|
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'
|
data/lib/opsmgr/version.rb
CHANGED