Class: GithubHerokuDeployer::Heroku
- Inherits:
-
Object
- Object
- GithubHerokuDeployer::Heroku
- Defined in:
- lib/github_heroku_deployer/heroku.rb
Instance Method Summary collapse
- #addon_add(addon, options = {}) ⇒ Object
- #addon_remove(addon) ⇒ Object
- #app ⇒ Object
- #config_set(config_vars) ⇒ Object
- #create_app ⇒ Object
- #destroy_app ⇒ Object
- #find_app ⇒ Object
- #find_or_create_app ⇒ Object
- #heroku ⇒ Object
-
#initialize(options) ⇒ Heroku
constructor
A new instance of Heroku.
- #post_ps_scale(process, quantity) ⇒ Object
- #restart_app ⇒ Object
- #run(command) ⇒ Object
Constructor Details
#initialize(options) ⇒ Heroku
Returns a new instance of Heroku.
6 7 8 9 |
# File 'lib/github_heroku_deployer/heroku.rb', line 6 def initialize() @heroku_api_key = [:heroku_api_key] @heroku_app_name = [:heroku_app_name] end |
Instance Method Details
#addon_add(addon, options = {}) ⇒ Object
49 50 51 |
# File 'lib/github_heroku_deployer/heroku.rb', line 49 def addon_add(addon, ={}) heroku.post_addon(@heroku_app_name, addon, ) end |
#addon_remove(addon) ⇒ Object
53 54 55 |
# File 'lib/github_heroku_deployer/heroku.rb', line 53 def addon_remove(addon) heroku.delete_addon(@heroku_app_name, addon) end |
#app ⇒ Object
15 16 17 |
# File 'lib/github_heroku_deployer/heroku.rb', line 15 def app @app ||= find_or_create_app end |
#config_set(config_vars) ⇒ Object
45 46 47 |
# File 'lib/github_heroku_deployer/heroku.rb', line 45 def config_set(config_vars) heroku.put_config_vars(@heroku_app_name, config_vars) end |
#create_app ⇒ Object
29 30 31 |
# File 'lib/github_heroku_deployer/heroku.rb', line 29 def create_app heroku.post_app(name: @heroku_app_name) end |
#destroy_app ⇒ Object
37 38 39 |
# File 'lib/github_heroku_deployer/heroku.rb', line 37 def destroy_app heroku.delete_app(@heroku_app_name) end |
#find_app ⇒ Object
25 26 27 |
# File 'lib/github_heroku_deployer/heroku.rb', line 25 def find_app heroku.get_app(@heroku_app_name) end |
#find_or_create_app ⇒ Object
19 20 21 22 23 |
# File 'lib/github_heroku_deployer/heroku.rb', line 19 def find_or_create_app find_app rescue ::Heroku::API::Errors::NotFound create_app end |
#heroku ⇒ Object
11 12 13 |
# File 'lib/github_heroku_deployer/heroku.rb', line 11 def heroku @heroku ||= ::Heroku::API.new(api_key: @heroku_api_key) end |
#post_ps_scale(process, quantity) ⇒ Object
57 58 59 |
# File 'lib/github_heroku_deployer/heroku.rb', line 57 def post_ps_scale(process, quantity) heroku.post_ps_scale(@heroku_app_name, process, quantity) end |
#restart_app ⇒ Object
33 34 35 |
# File 'lib/github_heroku_deployer/heroku.rb', line 33 def restart_app heroku.post_ps_restart(@heroku_app_name) end |
#run(command) ⇒ Object
41 42 43 |
# File 'lib/github_heroku_deployer/heroku.rb', line 41 def run(command) heroku.post_ps(@heroku_app_name, command) end |