Class: Bard::CI::Jenkins

Inherits:
Runner
  • Object
show all
Defined in:
lib/bard/ci/jenkins.rb

Constant Summary

Constants included from Retryable

Retryable::INITIAL_DELAY, Retryable::MAX_RETRIES

Instance Attribute Summary collapse

Attributes inherited from Runner

#branch, #project_name, #sha

Instance Method Summary collapse

Methods inherited from Runner

#resume, #run

Methods included from Retryable

#retry_with_backoff

Instance Attribute Details

#last_responseObject

Returns the value of attribute last_response.



17
18
19
# File 'lib/bard/ci/jenkins.rb', line 17

def last_response
  @last_response
end

Instance Method Details

#consoleObject



12
13
14
15
# File 'lib/bard/ci/jenkins.rb', line 12

def console
  raw = `curl -s #{ci_host}/lastBuild/console`
  raw[%r{<pre.*?>(.+)</pre>}m, 1]
end

#exists?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/bard/ci/jenkins.rb', line 8

def exists?
  `curl -s -I #{ci_host}/` =~ /\b200 OK\b/
end