Class: CheckDeploioStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/renuo/cli/app/check_deploio_status.rb

Overview

:nocov:

Constant Summary collapse

TIMEOUT_IN_SECONDS =
600
INTERVAL_IN_SECONDS =
30
APP_NAME =
ENV.fetch "DEPLOIO_APP_NAME", nil
PROJECT =
ENV.fetch "DEPLOIO_PROJECT", nil

Instance Method Summary collapse

Constructor Details

#initialize(opts) ⇒ CheckDeploioStatus

Returns a new instance of CheckDeploioStatus.



14
15
16
17
18
# File 'lib/renuo/cli/app/check_deploio_status.rb', line 14

def initialize(opts)
  abort "missing env DEPLOIO_APP_NAME" if APP_NAME.nil?
  abort "missing env DEPLOIO_PROJECT" if PROJECT.nil?
  @revision = opts.git_revision || `git rev-parse HEAD`.strip
end

Instance Method Details

#runObject



20
21
22
23
24
25
26
27
28
# File 'lib/renuo/cli/app/check_deploio_status.rb', line 20

def run
  puts "(1/2) Checking build status for revision #{@revision}..."
  poll "build"
  abort "build check timed out after #{TIMEOUT_IN_SECONDS} seconds" if build.nil?

  puts "(2/2) Checking release status for build #{build_name}..."
  poll "release"
  abort "release check timed out after #{TIMEOUT_IN_SECONDS} seconds" if release.nil?
end