summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-08 20:23:33 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-11-08 20:23:33 +0200
commitaf26839ae19ff8b6d1c6874eb7b6097511ee6d98 (patch)
tree37099d23f5e91122c2fe3616ba60619d109f1607 /lib
parent42b0763f454490e024a8fd16b922025aa337b80b (diff)
downloadgitlab-ci-af26839ae19ff8b6d1c6874eb7b6097511ee6d98.tar.gz
State machine added
Diffstat (limited to 'lib')
-rw-r--r--lib/runner.rb11
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/runner.rb b/lib/runner.rb
index dfea63f..09f5338 100644
--- a/lib/runner.rb
+++ b/lib/runner.rb
@@ -24,10 +24,7 @@ class Runner
path = project.path
commands = project.scripts
- build.update_attributes(
- started_at: Time.now,
- status: 'running'
- )
+ build.run!
Dir.chdir(path) do
commands.each_line do |line|
@@ -35,7 +32,7 @@ class Runner
build.write_trace(@output)
unless status
- build.fail!
+ build.drop!
return
end
end
@@ -44,10 +41,10 @@ class Runner
build.success!
rescue Errno::ENOENT
@output << "INVALID PROJECT PATH"
- build.fail!
+ build.drop!
rescue Timeout::Error
@output << "TIMEOUT"
- build.fail!
+ build.drop!
ensure
build.write_trace(@output)
end