diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-08 20:23:33 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-11-08 20:23:33 +0200 |
commit | af26839ae19ff8b6d1c6874eb7b6097511ee6d98 (patch) | |
tree | 37099d23f5e91122c2fe3616ba60619d109f1607 /lib | |
parent | 42b0763f454490e024a8fd16b922025aa337b80b (diff) | |
download | gitlab-ci-af26839ae19ff8b6d1c6874eb7b6097511ee6d98.tar.gz |
State machine added
Diffstat (limited to 'lib')
-rw-r--r-- | lib/runner.rb | 11 |
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 |