Class: Bard::CI::Jenkins

Inherits:
Runner
  • Object
show all
Defined in:
lib/bard/plugins/deploy/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

[], default, inherited, #resume, #run

Methods included from Retryable

#retry_with_backoff

Instance Attribute Details

#last_responseObject

Returns the value of attribute last_response.



33
34
35
# File 'lib/bard/plugins/deploy/ci/jenkins.rb', line 33

def last_response
  @last_response
end

Instance Method Details

#consoleObject



28
29
30
31
# File 'lib/bard/plugins/deploy/ci/jenkins.rb', line 28

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/plugins/deploy/ci/jenkins.rb', line 8

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