Sha256: 802c9493b878b51e1b9270327ce37f1882e3e878f3aab23d56f0a90dde3547bd

Contents?: true

Size: 827 Bytes

Versions: 2

Compression:

Stored size: 827 Bytes

Contents

require "capistrano-rails-server/recipes/common"

configuration = Capistrano::Configuration.respond_to?(:instance) ?
  Capistrano::Configuration.instance(:must_exist) :
  Capistrano.configuration(:must_exist)

configuration.load do
  namespace :key do
    desc "Generate deployment key for repository"
    task :generate, roles: :web do
      run %Q(ssh-keygen -q -N "" -t rsa -C #{user}@#{application} -f ~/.ssh/id_rsa)
      #run "ssh-add ~/.ssh/id_rsa"
    end
    after "deploy:install", "key:generate"

    desc "Show public key"
    task :show, roles: :web do
      run "cat ~/.ssh/id_rsa.pub"
    end
    after "key:generate", "key:show"

    desc "Remove key from server"
    task :remove, roles: :web do
      run "rm -rf ~/.ssh/id_rsa"
      run "rm -rf ~/.ssh/id_rsa.pub"
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-rails-server-1.2.0 lib/capistrano-rails-server/recipes/key.rb
capistrano-rails-server-1.1 lib/capistrano-rails-server/recipes/key.rb