Class: Bard::CI::Runner
- Inherits:
-
Struct
- Object
- Struct
- Bard::CI::Runner
- Includes:
- Retryable
- Defined in:
- lib/bard/ci/runner.rb
Direct Known Subclasses
Constant Summary
Constants included from Retryable
Bard::CI::Retryable::INITIAL_DELAY, Bard::CI::Retryable::MAX_RETRIES
Instance Attribute Summary collapse
-
#branch ⇒ Object
Returns the value of attribute branch.
-
#project_name ⇒ Object
Returns the value of attribute project_name.
-
#sha ⇒ Object
Returns the value of attribute sha.
Instance Method Summary collapse
Methods included from Retryable
Instance Attribute Details
#branch ⇒ Object
Returns the value of attribute branch
6 7 8 |
# File 'lib/bard/ci/runner.rb', line 6 def branch @branch end |
#project_name ⇒ Object
Returns the value of attribute project_name
6 7 8 |
# File 'lib/bard/ci/runner.rb', line 6 def project_name @project_name end |
#sha ⇒ Object
Returns the value of attribute sha
6 7 8 |
# File 'lib/bard/ci/runner.rb', line 6 def sha @sha end |
Instance Method Details
#resume ⇒ Object
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/bard/ci/runner.rb', line 22 def resume saved_state = state.load raise "No saved CI state found for #{project_name}. Start a new build with 'bard ci'." if saved_state.nil? restore_state(saved_state) poll_until_complete { |elapsed, last_time| yield elapsed, last_time } state.delete success? end |
#run ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bard/ci/runner.rb', line 9 def run start @start_time = Time.new.to_i @last_time_elapsed = get_last_time_elapsed save_state wait_until_started if respond_to?(:wait_until_started) poll_until_complete { |elapsed, last_time| yield elapsed, last_time } state.delete success? end |