#416: updated RpmWorkerObserver

This commit is contained in:
Vokhmin Alexey V 2014-07-24 23:02:08 +04:00
parent a9f94c552f
commit d77d6cb90a
2 changed files with 14 additions and 2 deletions

View File

@ -2,6 +2,11 @@ module AbfWorker
class RpmWorkerObserver < AbfWorker::BaseObserver
RESTARTED_BUILD_LISTS = 'abf-worker::rpm-worker-observer::restarted-build-lists'
# EXIT CODES:
# 6 - Unpermitted architecture
# other - Build error
EXIT_CODE_UNPERMITTED_ARCHITECTURE = 6
@queue = :rpm_worker_observer
def self.perform(options)
@ -29,7 +34,14 @@ module AbfWorker
subject.publish_into_testing
end
when FAILED
subject.build_error
case options['exit_status'].to_i
when EXIT_CODE_UNPERMITTED_ARCHITECTURE
subject.unpermitted_arch
else
subject.build_error
end
item.update_attributes({status: BuildList::BUILD_ERROR}) unless rerunning_tests
when STARTED
subject.start_build

View File

@ -191,7 +191,7 @@ class BuildList < ActiveRecord::Base
end
event :unpermitted_arch do
transition build_pending: :unpermitted_arch
transition [:build_started, :build_canceling, :build_canceled] => :unpermitted_arch
end
event :rerun_tests do