Sha256: 2d1e1a16bee5f162fedf4737e12a1a332098356534506b287187c9b68fd1ba1e

Contents?: true

Size: 948 Bytes

Versions: 130

Compression:

Stored size: 948 Bytes

Contents

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

set :backend, :ssh

def vagrant(cmd)
  Bundler.with_clean_env do
    env = {"VAGRANT_CWD" => File.dirname(__FILE__)}
    system env, "/usr/bin/vagrant #{cmd}"
  end
end

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']

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

130 entries across 130 versions & 1 rubygems

Version Path
itamae-1.0.0.beta50 spec/integration/spec_helper.rb
itamae-1.0.0.beta49 spec/integration/spec_helper.rb
itamae-1.0.0.beta48 spec/integration/spec_helper.rb
itamae-1.0.0.beta47 spec/integration/spec_helper.rb
itamae-1.0.0.beta46 spec/integration/spec_helper.rb
itamae-1.0.0.beta45 spec/integration/spec_helper.rb
itamae-1.0.0.beta44 spec/integration/spec_helper.rb
itamae-1.0.0.beta43 spec/integration/spec_helper.rb
itamae-1.0.0.beta42 spec/integration/spec_helper.rb
itamae-1.0.0.beta41 spec/integration/spec_helper.rb
itamae-1.0.0.beta40 spec/integration/spec_helper.rb
itamae-1.0.0.beta39 spec/integration/spec_helper.rb
itamae-1.0.0.beta38 spec/integration/spec_helper.rb
itamae-1.0.0.beta37 spec/integration/spec_helper.rb
itamae-1.0.0.beta36 spec/integration/spec_helper.rb
itamae-1.0.0.beta35 spec/integration/spec_helper.rb
itamae-1.0.0.beta34 spec/integration/spec_helper.rb
itamae-1.0.0.beta33 spec/integration/spec_helper.rb
itamae-1.0.0.beta32 spec/integration/spec_helper.rb
itamae-1.0.0.beta31 spec/integration/spec_helper.rb