Sha256: e4228e30b191b2ed4d17035a1a1ff3f94de983890840fa7c54d8993deab29fc7

Contents?: true

Size: 1013 Bytes

Versions: 5

Compression:

Stored size: 1013 Bytes

Contents

require 'serverspec'
require 'net/ssh'
require 'tempfile'

set :backend, :ssh

if ENV['ASK_SUDO_PASSWORD']
  begin
    require 'highline/import'
  rescue LoadError
    fail "highline is not available. Try installing it."
  end
  set :sudo_password, ask("Enter sudo password: ") { |q| q.echo = false }
else
  set :sudo_password, ENV['SUDO_PASSWORD']
end

host = ENV['TARGET_HOST']

`vagrant up #{host}`
system("bundle exec itamae ssh -h #{host} --vagrant '#{File.expand_path("../role.rb", __FILE__)}' -j '#{File.expand_path("../node.json", __FILE__)}' --log-level=#{ENV['LOG_LEVEL'] || 'INFO'}")

config = Tempfile.new('', Dir.tmpdir)
`vagrant ssh-config #{host} > #{config.path}`

options = Net::SSH::Config.for(host, [config.path])

options[:user] ||= Etc.getlogin

set :host,        options[:host_name] || host
set :ssh_options, options

# Disable sudo
# set :disable_sudo, true


# Set environment variables
# set :env, :LANG => 'C', :LC_MESSAGES => 'C' 

# Set PATH
# set :path, '/sbin:/usr/local/sbin:$PATH'

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
itamae-plugin-recipe-rtn_git-0.1.3 spec/spec_helper.rb
itamae-plugin-recipe-rtn_git-0.1.2 spec/spec_helper.rb
itamae-plugin-recipe-rtn_git-0.1.1 spec/spec_helper.rb
itamae-plugin-recipe-rtn_git-0.1.0 spec/spec_helper.rb
itamae-plugin-recipe-rtn_git-0.0.1 spec/spec_helper.rb