Class: Buildbox::Runner
- Inherits:
-
Object
- Object
- Buildbox::Runner
- Includes:
- Celluloid, Celluloid::Logger
- Defined in:
- lib/buildbox/runner.rb
Instance Attribute Summary collapse
-
#build ⇒ Object
readonly
Returns the value of attribute build.
Instance Method Summary collapse
-
#initialize(build) ⇒ Runner
constructor
A new instance of Runner.
- #start ⇒ Object
Constructor Details
#initialize(build) ⇒ Runner
Returns a new instance of Runner.
13 14 15 |
# File 'lib/buildbox/runner.rb', line 13 def initialize(build) @build = build end |
Instance Attribute Details
#build ⇒ Object (readonly)
Returns the value of attribute build.
11 12 13 |
# File 'lib/buildbox/runner.rb', line 11 def build @build end |
Instance Method Details
#start ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/buildbox/runner.rb', line 17 def start info "Starting to build #{namespace}/#{@build.number} starting..." info "Running command: #{command}" FileUtils.mkdir_p(directory_path) File.open(script_path, 'w+') { |file| file.write(@build.script) } build.output = "" result = Command.run(command, :directory => directory_path) do |chunk| build.output << chunk end build.output = result.output build.exit_status = result.exit_status info "#{namespace}/#{@build.number} finished" end |