opsmgr 0.34.19 → 0.34.20
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 +4 -4
- data/lib/opsmgr/bosh_command_runner.rb +23 -0
- data/lib/opsmgr/tasks/bosh.rake +17 -0
- data/lib/opsmgr/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 12db22e6ec81819b53b0fca4191574081a93c81a
|
|
4
|
+
data.tar.gz: 7c27dd87c7f452a125e40d8be7df58ff4dc0309c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 70135b0ac428b04cd61db23c5b62c034bc01d96bfd3a928a5cee2c0873cdf00983e8b161a11e8bc5ff5b0005eaf2b0ef26982bba49756e4f3e3a7edfdb3ba97c
|
|
7
|
+
data.tar.gz: 776d3cb415c2a535aa3933cbd950055f447ae4b0d16636c5b608044506e3f5b1daa52a2657e58f513a97af2293a84740866924a0eccb48cbcb5797cb8ba5d724
|
|
@@ -19,8 +19,31 @@ module Opsmgr
|
|
|
19
19
|
)
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
+
def run_with_deployment(command, deployment)
|
|
23
|
+
bosh_deployment = bosh_deployments[/#{deployment}-[0-9a-f]{8,}/]
|
|
24
|
+
fail 'Deployment not found' unless bosh_deployment
|
|
25
|
+
|
|
26
|
+
deployment_file = "#{ENV.fetch('TMPDIR', '/tmp')}/#{deployment}.yml"
|
|
27
|
+
|
|
28
|
+
begin
|
|
29
|
+
run(
|
|
30
|
+
"-n download manifest #{bosh_deployment} #{deployment_file}"
|
|
31
|
+
)
|
|
32
|
+
rescue RuntimeError
|
|
33
|
+
raise 'bosh download manifest failed'
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
run("-d #{deployment_file} #{command}")
|
|
37
|
+
end
|
|
38
|
+
|
|
22
39
|
private
|
|
23
40
|
|
|
41
|
+
def bosh_deployments
|
|
42
|
+
run_and_capture_output('deployments')
|
|
43
|
+
rescue RuntimeError
|
|
44
|
+
raise 'bosh deployments failed'
|
|
45
|
+
end
|
|
46
|
+
|
|
24
47
|
def system_or_fail(command, failure_message)
|
|
25
48
|
clean_and_log(command)
|
|
26
49
|
Bundler.clean_system(command) || fail(failure_message)
|
data/lib/opsmgr/tasks/bosh.rake
CHANGED
|
@@ -76,6 +76,23 @@ namespace :opsmgr do
|
|
|
76
76
|
logger: logger
|
|
77
77
|
).run(args.command)
|
|
78
78
|
end
|
|
79
|
+
|
|
80
|
+
desc 'run a bosh command with a deployment'
|
|
81
|
+
task :run_command_with_deployment, [:environment_name, :om_version, :command, :deployment] do |_, args|
|
|
82
|
+
require 'opsmgr/cmd/bosh_command'
|
|
83
|
+
require 'opsmgr/log'
|
|
84
|
+
require 'opsmgr/bosh_command_runner'
|
|
85
|
+
|
|
86
|
+
logger = Opsmgr.logger_for('Rake')
|
|
87
|
+
bosh_command = Opsmgr::Cmd::BoshCommand.new(
|
|
88
|
+
env_name: args.environment_name,
|
|
89
|
+
om_version: args.om_version
|
|
90
|
+
)
|
|
91
|
+
Opsmgr::BoshCommandRunner.new(
|
|
92
|
+
bosh_command: bosh_command,
|
|
93
|
+
logger: logger
|
|
94
|
+
).run_with_deployment(args.command, args.deployment)
|
|
95
|
+
end
|
|
79
96
|
end
|
|
80
97
|
# Copyright (c) 2014-2015 Pivotal Software, Inc.
|
|
81
98
|
# All rights reserved.
|
data/lib/opsmgr/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: opsmgr
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.34.
|
|
4
|
+
version: 0.34.20
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Release Engineering
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2016-
|
|
11
|
+
date: 2016-05-05 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rake
|