Sha256: f09b646dbb2f51b00471b1bd6a1e4b61a78877b1cad0f08801f91895d2028f86

Contents?: true

Size: 837 Bytes

Versions: 105

Compression:

Stored size: 837 Bytes

Contents

require 'serverspec'
require 'net/ssh'
require 'specinfra/helper/set'
require 'json'
include Specinfra::Helper::Set

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']
node_file = ENV['NODE_FILE']
attributes = JSON.parse(File.read(node_file), symbolize_names: true)
set_property attributes

options = Net::SSH::Config.for(host)
options[:user] = ENV['SSH_USER']
options[:password] = ENV['SSH_PASSWORD']
options[:keys] = ENV['SSH_KEY']
options[:port] = ENV['SSH_PORT']

set :host, options[:host_name] || host
set :shell, '/bin/bash'
set :ssh_options, options

Version data entries

105 entries across 44 versions & 1 rubygems

Version Path
itamae-mitsurin-0.50 test_project/spec/spec_helper.rb
itamae-mitsurin-0.50 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.49 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.49 test_project/spec/spec_helper.rb
itamae-mitsurin-0.48 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.48 test_project/spec/spec_helper.rb
itamae-mitsurin-0.47 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.47 test_project/spec/spec_helper.rb
itamae-mitsurin-0.46 test_project/spec/spec_helper.rb
itamae-mitsurin-0.46 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.45 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.45 test_project/spec/spec_helper.rb
itamae-mitsurin-0.44 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.44 test_project/spec/spec_helper.rb
itamae-mitsurin-0.43 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.43 test_project/spec/spec_helper.rb
itamae-mitsurin-0.42 test_project/spec/spec_helper.rb
itamae-mitsurin-0.42 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb
itamae-mitsurin-0.41 test_project/spec/spec_helper.rb
itamae-mitsurin-0.41 test/test_itamae-mitsurin/mitsurin/creators/templates/project/spec/spec_helper.rb