Class: DeepThought::CIService::TravisPlugin

Inherits:
CIService
  • Object
show all
Defined in:
lib/deep_thought-travis_plugin/ci_service/travis_plugin.rb

Instance Method Summary collapse

Instance Method Details

#is_branch_green?(app, branch, *args) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
12
13
14
15
16
17
# File 'lib/deep_thought-travis_plugin/ci_service/travis_plugin.rb', line 7

def is_branch_green?(app, branch, *args)
  is_green = false

  response = HTTParty.get("#{@endpoint}/repos/#{app}/branches/#{branch}")
  build = JSON.parse(response.body)

  if build['branch']['state'] == 'passing'
    return true
  end
  return false
end