kitchen-verifier-serverspec 0.4.6 → 0.5.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: 043246681b786882e2a9a6cf4fb1229fc09e8e2e
4
- data.tar.gz: 5a1ce432cdcabb18880f84ac20feca46a6252fc6
3
+ metadata.gz: 92eee699a25b9858785c62afe6b1229adefb4d84
4
+ data.tar.gz: 773c55c6a518ea01a19f26ef9875ef81ebd48795
5
5
  SHA512:
6
- metadata.gz: 850399866c291c374c1991773a2839a959a28d707cc3c0718add734a4c516c3e6da35cc6632eb5e6ca7ae272030b5c7fe8ba7af0ced45c098dd178b261769a89
7
- data.tar.gz: a334b7323080ba0051800e06dd7501f26822b09cb1398bda3e9e8c3c4169f9387d59c02f56ce2475dd80776cd2f8924c7c57ede4769d46a00702101c2108f61a
6
+ metadata.gz: c727e4cd38e374726343e416224e4114cd6ad54e2c4e29d800e51fe39c34c1ded8999c39e28fcd71ee45224d0f2fedcc0e24743ba654d995f30dc246157f927a
7
+ data.tar.gz: 5c122fc233630fdc5ea867dde2c46353a1efff38f8081558364205467ee14232a7452d69474b1ad861937252aa996431bd35132169283f7d9bfa0bd4c6a3c8b8
data/README.md CHANGED
@@ -58,7 +58,7 @@ http_proxy | nil | use http proxy when installing ruby, serverspec and running s
58
58
  https_proxy | nil | use https proxy when installing puppet, ruby, serverspec and running serverspec
59
59
  sudo | nil | use sudo to run commands
60
60
  sudo_command | 'sudo -E -H' | sudo command to run when sudo set to true
61
- env_vars | {} | environment variable to set for rspec
61
+ env_vars | {} | environment variable to set for rspec and can be used in the spec_helper. It will automatically pickup any environment variables set with a KITCHEN_ prefix.
62
62
  bundler_path | | override path for bundler command
63
63
  rspec_path | | override path for rspec command
64
64
  runner_url | https://raw.githubusercontent.com /neillturner/serverspec-runners/ master/ansiblespec_runner.rb | url for custom runner
@@ -167,7 +167,6 @@ end
167
167
  ## Locally on your workstation running serverspec in ssh mode
168
168
 
169
169
  This allows you not to have to install ruby and serverspec on the server being configured as serverspec is run on your workstation in ssh mode.
170
-
171
170
  ```yaml
172
171
  verifier:
173
172
  name: serverspec
@@ -181,11 +180,20 @@ suites:
181
180
  verifier:
182
181
  patterns:
183
182
  - modules_mycompany/mycompany_base/spec/acceptance/base_local_spec.rb
184
- env_vars:
185
- TARGET_HOST: 127.0.0.1
186
- TARGET_PORT: 2222
187
- LOGIN_USER: vagrant
188
- SSH_KEY: 'c:/repository/puppet_repo/private_key.pem'
183
+
184
+ ```
185
+
186
+ Set environment variables dynamically on your workstation
187
+ ```
188
+ export KITCHEN_HOST=127.0.0.1
189
+ export KITCHEN_PORT=2222
190
+ export KITCHEN_USERNAME=vagrant
191
+ export KITCHEN_SSH_KEY='c:/repository/puppet_repo/private_key.pem'
192
+ Or for Windows Workstations:
193
+ set KITCHEN_HOST=127.0.0.1
194
+ set KITCHEN_PORT=2222
195
+ set KITCHEN_USERNAME=vagrant
196
+ set KITCHEN_SSH_KEY='c:/repository/puppet_repo/private_key.pem'
189
197
  ```
190
198
 
191
199
  The spec/spec_helper.rb should contain
@@ -199,12 +207,10 @@ require 'pathname'
199
207
  require 'net/ssh'
200
208
 
201
209
  RSpec.configure do |config|
202
- set :host, ENV['TARGET_HOST']
210
+ set :host, ENV['KITCHEN_HOSTNAME']
203
211
  # ssh options at http://net-ssh.github.io/ssh/v1/chapter-2.html
204
- # ssh via password, set :version to :debug for debugging
205
- #set :ssh_options, :user => ENV['LOGIN_USER'], :paranoid => false, :verbose => :info, :password => ENV['LOGIN_PASSWORD'] if ENV['LOGIN_PASSWORD']
206
212
  # ssh via ssh key
207
- set :ssh_options, :user => ENV['LOGIN_USER'], :paranoid => false, :verbose => :error, :host_key => 'ssh-rsa', :keys => [ ENV['SSH_KEY'] ] if ENV['SSH_KEY']
213
+ set :ssh_options, :user => ENV['KITCHEN_USERNAME'], :port => ENV['KITCHEN_PORT'], :paranoid => false, :verbose => :error, :host_key => 'ssh-rsa', :keys => [ ENV['KITCHEN_SSH_KEY'] ]
208
214
  set :backend, :ssh
209
215
  set :request_pty, true
210
216
  end
@@ -374,6 +374,8 @@ module Kitchen
374
374
  env_state[:environment]['KITCHEN_SUITE'] = instance.suite.name
375
375
  state.each_pair do |key, value|
376
376
  env_state[:environment]['KITCHEN_' + key.to_s.upcase] = value
377
+ ENV['KITCHEN_' + key.to_s.upcase] = value.to_s
378
+ info("Environment variable #{'KITCHEN_' + key.to_s.upcase} value #{value}")
377
379
  end
378
380
  config[:shellout_opts].merge!(env_state)
379
381
  end
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Verifier
3
- SERVERSPEC_VERSION = '0.4.6'.freeze
3
+ SERVERSPEC_VERSION = '0.5.0'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-verifier-serverspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neill Turner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-31 00:00:00.000000000 Z
11
+ date: 2016-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen