opskeleton 0.7.0 → 0.7.1
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/Gemfile.lock +1 -1
- data/lib/opskeleton/version.rb +1 -1
- data/templates/parent/spec/spec_helper.rb +31 -16
- data/templates/puppet/opsk.yaml +1 -0
- 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: 1a5ac47a5adfbfcb23b17b3cd11a8f7898f4b6fc
|
4
|
+
data.tar.gz: c3a72f36fb8f572007d2f540199e23015707809d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6129a1aca0ab8a40787f4e6d5fafceda42f60fc7d4b4f686dc6a66463f64d3bca860dae93d2a471a119cb7e7aa6d5f4b0033d5bd3ebf0b77a1bc294850f40b20
|
7
|
+
data.tar.gz: a95d1e9651fe865593b3048c2d7c229ee2d7e7e06f0de3b7dc81440e614e753ee3e7c4f7c59a7b5cb2ff7e04f4770b5d57491d30cd630ccdb6ac7e91a84a3f2a
|
data/Gemfile.lock
CHANGED
data/lib/opskeleton/version.rb
CHANGED
@@ -5,29 +5,44 @@ require 'net/ssh'
|
|
5
5
|
include SpecInfra::Helper::Ssh
|
6
6
|
include SpecInfra::Helper::DetectOS
|
7
7
|
|
8
|
+
def run(cmd)
|
9
|
+
unless(system(cmd, out: $stdout, err: :out))
|
10
|
+
puts 'Failed to setup vagrant machine'
|
11
|
+
System.exit 1
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
8
15
|
RSpec.configure do |c|
|
9
|
-
c.before :
|
16
|
+
c.before :suite do
|
10
17
|
c.host = ENV['TARGET_HOST']
|
11
18
|
c.ssh.close if c.ssh
|
12
19
|
options = Net::SSH::Config.for(c.host)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
20
|
+
if(!ENV['LOCAL'])
|
21
|
+
run("vagrant up #{c.host}")
|
22
|
+
config = `vagrant ssh-config #{c.host}`
|
23
|
+
sshhost = sshuser = ''
|
24
|
+
if config != ''
|
25
|
+
config.each_line do |line|
|
26
|
+
if match = /HostName (.*)/.match(line)
|
27
|
+
sshhost = match[1]
|
28
|
+
elsif match = /User (.*)/.match(line)
|
29
|
+
sshuser = match[1]
|
30
|
+
elsif match = /IdentityFile (.*)/.match(line)
|
31
|
+
options[:keys] = [match[1].gsub(/"/,'')]
|
32
|
+
elsif match = /Port (.*)/.match(line)
|
33
|
+
options[:port] = match[1]
|
34
|
+
end
|
27
35
|
end
|
28
36
|
end
|
37
|
+
else
|
38
|
+
sshhost = 'localhost'
|
39
|
+
sshuser = 'vagrant'
|
29
40
|
end
|
30
|
-
|
31
41
|
c.ssh = Net::SSH.start(sshhost, sshuser, options)
|
32
42
|
end
|
43
|
+
|
44
|
+
c.after :suite do
|
45
|
+
c.host = ENV['TARGET_HOST']
|
46
|
+
run("vagrant destroy #{c.host} -f")
|
47
|
+
end
|
33
48
|
end
|
data/templates/puppet/opsk.yaml
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: opskeleton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- narkisr
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|