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_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

Raises:

  • (NotImplementedError)


70
71
72
# File 'lib/bob/buildable.rb', line 70

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

#scmObject

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

Raises:

  • (NotImplementedError)


13
14
15
# File 'lib/bob/buildable.rb', line 13

def scm
  raise NotImplementedError
end

#start_buildingObject

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

#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