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_info, build_status, build_output) ⇒ Object
Callback sent after a build finishes.
-
#scm ⇒ Object
What kind of repository this buildable represents.
-
#start_building ⇒ Object
Optional callback sent when the 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_info, build_status, build_output) ⇒ Object
Callback sent after a build finishes. The first argument is a hash with information about the commit.
identifier
-
A string with the commit identifier of the
commit that was built
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
The second argument is a boolean indicating whether the build was successful. Finally, 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
70 71 72 |
# File 'lib/bob/buildable.rb', line 70 def finish_building(commit_info, build_status, build_output) raise NotImplementedError end |
#scm ⇒ Object
What kind of repository this buildable represents. Must return a String (“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 ⇒ Object
Optional callback sent when the build starts. It can be used to calculate the build duration for example.
53 54 |
# File 'lib/bob/buildable.rb', line 53 def start_building 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 |