Sha256: 0ea286a2f9ac37da072ab3f1bb45fb029dc311417eee4bba4b820d1616786bb5

Contents?: true

Size: 756 Bytes

Versions: 34

Compression:

Stored size: 756 Bytes

Contents

require_relative 'paths'

module SshHelper
    include Paths

    private
    def path_to_ssh
        "#{Dir.home}/.ssh"
    end
    
    def path_to_jenkins_ssh
        "#{path_to_environment}/ssh"
    end
    
    def path_to_backup_ssh
        "#{path_to_backup}/ssh"
    end
    
    public
    def move_ssh_to_backup
        FileUtils::mv(path_to_ssh, path_to_backup_ssh, :force => true)
    end
    
    def restore_backup_ssh
        FileUtils::mv(path_to_backup_ssh, path_to_ssh, :force => true)
    end
    
    def copy_jenkins_ssh
        FileUtils::cp_r("#{path_to_jenkins_ssh}/.", path_to_ssh)
        FileUtils::chmod(0700, "#{path_to_ssh}/id_rsa_ololo")
    end
    
    def remove_local_ssh 
        FileUtils::rm_r(path_to_ssh)
    end
end

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
nixenvironment-0.0.113 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.112 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.111 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.110 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.109 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.108 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.107 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.106 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.105 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.104 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.103 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.102 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.101 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.100 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.99 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.98 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.97 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.96 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.95 lib/nixenvironment/jenkins/Modules/ssh_helper.rb
nixenvironment-0.0.94 lib/nixenvironment/jenkins/Modules/ssh_helper.rb