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’.

Instance Attribute Summary collapse

Attributes included from ResourcesHelper

#resources

Instance Method Summary collapse

Methods included from Shell

sh_out, #sh_step, #shell

Methods included from DoctorHelper

#doctor_hook

Constructor Details

#initialize(slug, pro: false) ⇒ TravisDeploy

Returns a new instance of TravisDeploy.



13
14
15
16
17
# File 'lib/moonshot/build_mechanism/travis_deploy.rb', line 13

def initialize(slug, pro: false)
  @slug = slug
  @endpoint = pro ? '--pro' : '--org'
  @cli_args = "-r #{@slug} #{@endpoint}"
end

Instance Attribute Details

#output_fileObject (readonly)

Returns the value of attribute output_file.



11
12
13
# File 'lib/moonshot/build_mechanism/travis_deploy.rb', line 11

def output_file
  @output_file
end

Instance Method Details

#build_hook(version) ⇒ Object



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

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

#post_build_hook(_) ⇒ Object



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

def post_build_hook(_)
end

#pre_build_hook(_) ⇒ Object



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

def pre_build_hook(_)
end