Sha256: 69d25a2b84fc3828ab28bb9d38b2eea3e3dabf1f821625928eb0869b6bd2a97d

Contents?: true

Size: 604 Bytes

Versions: 1

Compression:

Stored size: 604 Bytes

Contents

require "cap-ssh-key-man/public_key_combiner"
Capistrano::Configuration.instance(true).load do
  namespace :cap_ssh_key_man do
    desc "Sync keys to servers"
    task :sync do
      puts "Creating authorized_keys file ..."
      CapSshKeyMan::PublicKeyCombiner.combine_developer_public_keys

      puts "Deploying authorized_keys ..."
      tmp_authorized_keys_path = File.join(".", "tmp", "authorized_keys")
      put File.read(tmp_authorized_keys_path), File.join("/home/#{user}", "authorized_keys")

      # delete temp file after use it.
      FileUtils.rm tmp_authorized_keys_path
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cap-ssh-key-man-1.0.0 lib/cap-ssh-key-man/tasks/sync.rb