Module: Bob::Buildable
- 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(commits) ⇒ Object
Builds the list of commits you pass.
-
#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.
-
#finish_building(commit_id, build_status, build_output) ⇒ Object
Callback sent after a build finishes.
-
#kind ⇒ 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
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_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
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
66 67 68 |
# File 'lib/bob/buildable.rb', line 66 def finish_building(commit_id, build_status, build_output) raise NotImplementedError end |
#kind ⇒ 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
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
54 55 56 |
# File 'lib/bob/buildable.rb', line 54 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
23 24 25 |
# File 'lib/bob/buildable.rb', line 23 def uri raise NotImplementedError end |