Module: Bob::Buildable
- Included in:
- Test::BuildableStub
- Defined in:
- lib/bob/buildable.rb
Overview
Mixin to add to your classes.
Instance Method Summary collapse
-
#branch ⇒ Object
Branch of the code you want to watch in order to build.
-
#build ⇒ Object
Build itself.
-
#build_script ⇒ Object
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.
-
#commit ⇒ Object
Indentifier of the commit to build.
-
#finish_building(commit_id, build_status, build_output) ⇒ Object
Callback sent after a build finishes.
-
#scm ⇒ Object
What kind of repository this buildable represents.
-
#start_building(commit_id, commit_info) ⇒ Object
Callback sent when a build starts.
-
#uri ⇒ Object
Full URI to the repository to clone/checkout.
Instance Method Details
#branch ⇒ Object
Branch of the code you want to watch in order to build.
You must implement this in the classes where you mixin this module
27 28 29 |
# File 'lib/bob/buildable.rb', line 27 def branch raise NotImplementedError end |
#build ⇒ Object
Build itself.
5 6 7 |
# File 'lib/bob/buildable.rb', line 5 def build Bob.build(self) end |
#build_script ⇒ Object
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
47 48 49 |
# File 'lib/bob/buildable.rb', line 47 def build_script raise NotImplementedError end |
#commit ⇒ Object
Indentifier of the commit to build.
The special identifier :head
will be resolved to the head commit of the current branch (for example, “HEAD” under git or the latest revision under svn)
You must implement this in the classes where you mixin this module
38 39 40 |
# File 'lib/bob/buildable.rb', line 38 def commit 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
74 75 76 |
# File 'lib/bob/buildable.rb', line 74 def finish_building(commit_id, build_status, build_output) raise NotImplementedError end |
#scm ⇒ Object
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
13 14 15 |
# File 'lib/bob/buildable.rb', line 13 def scm 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
62 63 64 |
# File 'lib/bob/buildable.rb', line 62 def start_building(commit_id, commit_info) raise NotImplementedError end |
#uri ⇒ Object
Full URI to the repository to clone/checkout.
You must implement this in the classes where you mixin this module
20 21 22 |
# File 'lib/bob/buildable.rb', line 20 def uri raise NotImplementedError end |