Class: Hatchet::GitApp

Inherits:
App
  • Object
show all
Defined in:
lib/hatchet/git_app.rb

Overview

used for deploying a test app to heroku via git

Constant Summary

Constants inherited from App

App::DEFAULT_REPO_NAME, App::DefaultCommand, App::HATCHET_BUILDPACK_BASE, App::HATCHET_BUILDPACK_BRANCH, App::SkipDefaultOption

Instance Attribute Summary

Attributes inherited from App

#app_config, #buildpacks, #max_retries_count, #name, #reaper, #repo_name, #stack

Instance Method Summary collapse

Methods inherited from App

#add_database, #allow_failure?, #annotate_failures, #api_key, #api_rate_limit, #before_deploy, #commit!, config, #config, #couple_pipeline, #create_app, #create_pipeline, #create_source, #debug?, default_buildpack, #delete_pipeline, #deploy, #deployed?, #directory, #get_config, #get_labs, #heroku, #in_directory, #in_directory_fork, #initialize, #lab_is_installed?, #not_debugging?, #original_source_code_directory, #output, #pipeline_id, #platform_api, #push, #retry_error_message, #run, #run_ci, #run_multi, #set_config, #set_lab, #set_labs!, #setup!, #source_get_url, #teardown!, #update_stack

Constructor Details

This class inherits a constructor from Hatchet::App

Instance Method Details

#git_repoObject



4
5
6
# File 'lib/hatchet/git_app.rb', line 4

def git_repo
  "https://git.heroku.com/#{name}.git"
end

#push_without_retry!Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/hatchet/git_app.rb', line 8

def push_without_retry!
  output = ""

  ShellThrottle.new(platform_api: @platform_api).call do
    begin
      output = git_push_heroku_yall
    rescue FailedDeploy => e
      case e.output
      when /reached the API rate limit/, /429 Too Many Requests/, /HTTP 429/, /HTTP code = 429/
        throw(:throttle)
      else
        raise e unless @allow_failure
        output = e.output
      end
    end
  end

  return output
end

#releasesObject



28
29
30
# File 'lib/hatchet/git_app.rb', line 28

def releases
  platform_api.release.list(name)
end