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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a8b5625f8be2bf3a45e1dd3554aabce54c64ac05
4
- data.tar.gz: b3676744041d0337f721ce3d9f07a92d537f145c
3
+ metadata.gz: 1a5ac47a5adfbfcb23b17b3cd11a8f7898f4b6fc
4
+ data.tar.gz: c3a72f36fb8f572007d2f540199e23015707809d
5
5
  SHA512:
6
- metadata.gz: 19c555108388d8d5e94aaa91422ac36706c1f3280f7bd4540020f29049a4241756821f8196ed6aacc9695fecea3bb7774cd9b7fdbb6bb0d8a7d57f972cee67a7
7
- data.tar.gz: 7031895bb8a7dfb6da1b97f7342b516654a4b2a8d98645929353d5b06dd52ab4794b37a60000b3c7763e7eb07adcde2016ba5af28f1600b9bcd5e8b465cd9c0c
6
+ metadata.gz: 6129a1aca0ab8a40787f4e6d5fafceda42f60fc7d4b4f686dc6a66463f64d3bca860dae93d2a471a119cb7e7aa6d5f4b0033d5bd3ebf0b77a1bc294850f40b20
7
+ data.tar.gz: a95d1e9651fe865593b3048c2d7c229ee2d7e7e06f0de3b7dc81440e614e753ee3e7c4f7c59a7b5cb2ff7e04f4770b5d57491d30cd630ccdb6ac7e91a84a3f2a
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- opskeleton (0.7.0)
4
+ opskeleton (0.7.1)
5
5
  bintray_deploy
6
6
  thor
7
7
 
@@ -1,3 +1,3 @@
1
1
  module Opskeleton
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
@@ -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 :all do
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
- user = 'vagrant'
14
- vagrant_up = `vagrant up #{c.host}`
15
- config = `vagrant ssh-config #{c.host}`
16
- sshhost = sshuser = ''
17
- if config != ''
18
- config.each_line do |line|
19
- if match = /HostName (.*)/.match(line)
20
- sshhost = match[1]
21
- elsif match = /User (.*)/.match(line)
22
- sshuser = match[1]
23
- elsif match = /IdentityFile (.*)/.match(line)
24
- options[:keys] = [match[1].gsub(/"/,'')]
25
- elsif match = /Port (.*)/.match(line)
26
- options[:port] = match[1]
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
@@ -6,6 +6,7 @@
6
6
  - modules
7
7
  - manifests
8
8
  - hieradata
9
+ - hiera.yaml
9
10
  - static-modules
10
11
  - Gemfile
11
12
  - Gemfile.lock
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.0
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-09-26 00:00:00.000000000 Z
11
+ date: 2014-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor