Class: Takeoff::Stage::Log

Inherits:
Base
  • Object
show all
Defined in:
lib/takeoff/stage/log.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Methods included from Helpers

#branches_up_to_date?, #diff, #execute, #file_has_changed_locally?, #files_have_changed?, #latest_commit, #log

Constructor Details

This class inherits a constructor from Takeoff::Stage::Base

Instance Method Details

#call(env) ⇒ Object



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/takeoff/stage/log.rb', line 6

def call(env)
  log "Ready for takeoff! Deploying to #{env[:environment]} server..."

  start_time = Time.now

  begin
    @app.call(env)
  rescue
    end_time = Time.now

    log "Deploying failed in #{end_time - start_time} seconds. Takeoff unsuccessful."
    puts

    raise
  else
    end_time = Time.now

    log "Deploying finished in #{end_time - start_time} seconds. Takeoff successful."
  end
end