Class: DPL::Provider::Heroku::GitDeployKey

Inherits:
GitSSH show all
Defined in:
lib/dpl/provider/heroku/git_deploy_key.rb

Instance Attribute Summary

Attributes inherited from DPL::Provider

#context, #options

Instance Method Summary collapse

Methods inherited from GitSSH

#git_url, #remove_key, #setup_key

Methods inherited from Git

#git_url, #push_app, #write_netrc

Methods inherited from Generic

#api, #api_options, #check_app, #deploy, #info, #restart, #run, #user

Methods inherited from DPL::Provider

apt_get, #check_app, #cleanup, #commit_msg, context, #create_key, #default_text_charset, #default_text_charset?, #deploy, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #sha, shell, #uncleanup, #user_agent, #warn

Constructor Details

This class inherits a constructor from DPL::Provider

Instance Method Details

#check_authObject



9
10
11
12
# File 'lib/dpl/provider/heroku/git_deploy_key.rb', line 9

def check_auth
  super
  setup_git_ssh
end

#needs_key?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'lib/dpl/provider/heroku/git_deploy_key.rb', line 5

def needs_key?
  false
end

#setup_git_sshObject



14
15
16
17
18
19
20
21
22
23
24
# File 'lib/dpl/provider/heroku/git_deploy_key.rb', line 14

def setup_git_ssh
  path = File.expand_path(".dpl/git-ssh")

  File.open(path, 'w') do |file|
    file.write "#!/bin/sh\n"
    file.write "exec ssh -o StrictHostKeychecking=no -o CheckHostIP=no -o UserKnownHostsFile=/dev/null -- \"$@\"\n"
  end

  chmod(0740, path)
  context.env['GIT_SSH'] = path
end