Sha256: 13d1fcdc8fe88673af2a509008d2c42e3bb40a63f6ca1ab73738f0cbbd5d30ff

Contents?: true

Size: 866 Bytes

Versions: 10

Compression:

Stored size: 866 Bytes

Contents

Dir.glob("#{File.dirname(__FILE__)}/*.rake").each { |r| load r }
Dir.glob("#{File.dirname(__FILE__)}/config/*.rake").each { |r| load r }

## Common libraries
def template(template_name, target_path)
  begin
    file = File.read("#{File.dirname(__FILE__)}/config/templates/#{template_name}.erb")
  rescue
    file = File.read("lib/capistrano/config/templates/#{template_name}.erb")
  end

  template = ERB.new file, nil, "%"
  rendered = template.result(binding)
  tmp_file = "/tmp/#{SecureRandom.hex}.#{template_name}"
  upload! StringIO.new(rendered), tmp_file
  execute "sudo cp #{tmp_file} #{target_path}"
  execute  "rm #{tmp_file}"
end

## Bastion config
def bastion(host, user:)
  require 'net/ssh/proxy/command'
  ssh_command = "ssh -W %h:%p -o StrictHostKeyChecking=no #{user}@#{host}"
  set :ssh_options, proxy: Net::SSH::Proxy::Command.new(ssh_command)
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
prun-ops-0.2.18 lib/capistrano/prun-ops.rb
prun-ops-0.2.17 lib/capistrano/prun-ops.rb
prun-ops-0.2.16 lib/capistrano/prun-ops.rb
prun-ops-0.2.15 lib/capistrano/prun-ops.rb
prun-ops-0.2.14 lib/capistrano/prun-ops.rb
prun-ops-0.2.13 lib/capistrano/prun-ops.rb
prun-ops-0.2.12 lib/capistrano/prun-ops.rb
prun-ops-0.2.11 lib/capistrano/prun-ops.rb
prun-ops-0.2.10 lib/capistrano/prun-ops.rb
prun-ops-0.2.9 lib/capistrano/prun-ops.rb