Class: Renuo::Cli::Commands::CheckDeploioStatus

Inherits:
Object
  • Object
show all
Defined in:
lib/renuo/cli/commands/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(options) ⇒ CheckDeploioStatus



19
20
21
22
23
# File 'lib/renuo/cli/commands/check_deploio_status.rb', line 19

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

Instance Method Details

#runObject



25
26
27
28
29
30
31
32
33
# File 'lib/renuo/cli/commands/check_deploio_status.rb', line 25

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