Class: DPL::Provider::Heroku::Git
- Inherits:
-
Generic
- Object
- DPL::Provider
- Generic
- DPL::Provider::Heroku::Git
- Defined in:
- lib/dpl/provider/heroku/git.rb
Instance Attribute Summary
Attributes inherited from DPL::Provider
Instance Method Summary collapse
Methods inherited from Generic
#api, #api_options, #check_app, #check_auth, #deploy, #info, #needs_key?, #restart, #run, #user
Methods inherited from DPL::Provider
apt_get, #check_app, #cleanup, #commit_msg, context, #create_key, #deploy, #detect_encoding?, #encoding_for, #error, experimental, #initialize, #log, #needs_key?, new, npm_g, #option, pip, requires, #run, #setup_git_credentials, #setup_git_ssh, #sha, shell, #uncleanup, #user_agent, #warn
Constructor Details
This class inherits a constructor from DPL::Provider
Instance Method Details
#git_url ⇒ Object
7 8 9 |
# File 'lib/dpl/provider/heroku/git.rb', line 7 def git_url "https://git.heroku.com/#{option(:app)}.git" end |
#push_app ⇒ Object
11 12 13 14 15 |
# File 'lib/dpl/provider/heroku/git.rb', line 11 def push_app git_remote = [:git] || git_url write_netrc if git_remote.start_with?("https://") context.shell "git push #{git_remote} HEAD:refs/heads/master -f" end |
#write_netrc ⇒ Object
17 18 19 20 21 |
# File 'lib/dpl/provider/heroku/git.rb', line 17 def write_netrc n = Netrc.read n['git.heroku.com'] = [user, option(:api_key)] n.save end |