Class: Bozo::Hooks::GitHub

Inherits:
Object
  • Object
show all
Defined in:
lib/bozo/hooks/git_hub.rb

Overview

Hooks for notifying GitHub of the build

The following env variables are required

  • BUILD_URL

  • BUILD_NUMBER

with_hook :git_hub do |h|

h.token '.....'
h.owner 'zopaUK'
h.repo  'bozo-scripts'

end

Instance Method Summary collapse

Instance Method Details

#failed_buildObject



28
29
30
# File 'lib/bozo/hooks/git_hub.rb', line 28

def failed_build
  submit_notification(:failure, "Build #{build_number} failed")
end

#owner(owner) ⇒ Object



36
37
38
# File 'lib/bozo/hooks/git_hub.rb', line 36

def owner(owner)
  @owner = owner
end

#post_buildObject



24
25
26
# File 'lib/bozo/hooks/git_hub.rb', line 24

def post_build
  submit_notification(:success, "Build #{build_number} succeeded")
end

#pre_buildObject



20
21
22
# File 'lib/bozo/hooks/git_hub.rb', line 20

def pre_build
  submit_notification(:pending, "Build #{build_number} pending")
end

#repo(repo) ⇒ Object



40
41
42
# File 'lib/bozo/hooks/git_hub.rb', line 40

def repo(repo)
  @repo = repo
end

#token(token) ⇒ Object



32
33
34
# File 'lib/bozo/hooks/git_hub.rb', line 32

def token(token)
  @token = token
end