Class: Moonshot::BuildMechanism::TravisDeploy

Inherits:
Object
  • Object
show all
Includes:
DoctorHelper, ResourcesHelper, Shell
Defined in:
lib/moonshot/build_mechanism/travis_deploy.rb

Overview

This simply waits for Travis-CI to finish building a job matching the version and ‘BUILD=1’.

Constant Summary collapse

MAX_BUILD_FIND_ATTEMPTS =
10

Constants included from Shell

Shell::CommandError, Shell::DEFAULT_RETRY_OPTIONS

Instance Attribute Summary collapse

Attributes included from ResourcesHelper

#resources

Instance Method Summary collapse

Methods included from Shell

sh_out, #sh_retry, #sh_step, #shell

Methods included from DoctorHelper

#doctor_hook

Constructor Details

#initialize(slug, pro: false, timeout: 900) ⇒ TravisDeploy

Returns a new instance of TravisDeploy.



20
21
22
23
24
25
26
27
28
# File 'lib/moonshot/build_mechanism/travis_deploy.rb', line 20

def initialize(slug, pro: false, timeout: 900)
  @slug = slug
  @pro = pro
  @timeout = timeout

  @endpoint = pro ? '--pro' : '--org'
  @travis_base = @pro ? Travis::Pro : Travis
  @cli_args = "-r #{@slug} #{@endpoint}"
end

Instance Attribute Details

#output_fileObject (readonly)

Returns the value of attribute output_file.



18
19
20
# File 'lib/moonshot/build_mechanism/travis_deploy.rb', line 18

def output_file
  @output_file
end

Instance Method Details

#build_hook(version) ⇒ Object



32
33
34
35
36
# File 'lib/moonshot/build_mechanism/travis_deploy.rb', line 32

def build_hook(version)
  job_number = find_build_and_job(version)
  wait_for_job(job_number)
  check_build(version)
end

#post_build_hook(_) ⇒ Object



38
# File 'lib/moonshot/build_mechanism/travis_deploy.rb', line 38

def post_build_hook(_); end

#pre_build_hook(_) ⇒ Object



30
# File 'lib/moonshot/build_mechanism/travis_deploy.rb', line 30

def pre_build_hook(_); end