Module: Bob::Buildable

Included in:
Test::BuildableStub
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)


27
28
29
# File 'lib/bob/buildable.rb', line 27

def branch
  raise NotImplementedError
end

#buildObject

Build itself.



5
6
7
# File 'lib/bob/buildable.rb', line 5

def build
  Bob.build(self)
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)


47
48
49
# File 'lib/bob/buildable.rb', line 47

def build_script
  raise NotImplementedError
end

#commitObject

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

Raises:

  • (NotImplementedError)


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

Raises:

  • (NotImplementedError)


74
75
76
# File 'lib/bob/buildable.rb', line 74

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

#scmObject

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)


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

Raises:

  • (NotImplementedError)


62
63
64
# File 'lib/bob/buildable.rb', line 62

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)


20
21
22
# File 'lib/bob/buildable.rb', line 20

def uri
  raise NotImplementedError
end