Module: Bob::Buildable

Defined in:
lib/bob/buildable.rb

Overview

Mixin to add to your classes.

Instance Method Summary collapse

Instance Method Details

#branchObject

Branch of the code you want to watch in order to build.

You must implement this in the classes where you mixin this module

Raises:

  • (NotImplementedError)


30
31
32
# File 'lib/bob/buildable.rb', line 30

def branch
  raise NotImplementedError
end

#build(commits) ⇒ Object

Builds the list of commits you pass. You must provide an enumerable with commit identifiers appropriate to the repository the code is in (SHAs if git, rev numbers if svn, etc), or a single string with a commit id.



8
9
10
# File 'lib/bob/buildable.rb', line 8

def build(commits)
  Bob.build(self, commits)
end

#build_scriptObject

Script that will be run in the buildable’s checked out code, if it returns a status code of 0 it will be considered a successfull build. Else it will be considered a failed build.

You must implement this in the classes where you mixin this module

Raises:

  • (NotImplementedError)


39
40
41
# File 'lib/bob/buildable.rb', line 39

def build_script
  raise NotImplementedError
end

#finish_building(commit_id, build_status, build_output) ⇒ Object

Callback sent after a build finishes. The first argument is a string with whatever identifier is appropriate for a respository of this kind. The second is a boolean which is true if the build was successful or false if it failed. And the last one is a string with the full output returned by the build process (STDOUT and STDERR interleaved)

You must implement this in the classes where you mixin this module

Raises:

  • (NotImplementedError)


66
67
68
# File 'lib/bob/buildable.rb', line 66

def finish_building(commit_id, build_status, build_output)
  raise NotImplementedError
end

#kindObject

What kind of repository this buildable represents. Must return a Symbol (:git, :svn, etc.)

You must implement this in the classes where you mixin this module

Raises:

  • (NotImplementedError)


16
17
18
# File 'lib/bob/buildable.rb', line 16

def kind
  raise NotImplementedError
end

#start_building(commit_id, commit_info) ⇒ Object

Callback sent when a build starts. The first argument is a string with whatever identifier is appropriate for a repository of this kind. The second is a hash with information about the commit.

:author

A string with the name/email of the committer

:message

The commit message

:committed_at

A Time object with the timestamp of the commit

You must implement this in the classes where you mixin this module

Raises:

  • (NotImplementedError)


54
55
56
# File 'lib/bob/buildable.rb', line 54

def start_building(commit_id, commit_info)
  raise NotImplementedError
end

#uriObject

Full URI to the repository to clone/checkout.

You must implement this in the classes where you mixin this module

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/bob/buildable.rb', line 23

def uri
  raise NotImplementedError
end