Redo build_list publish to check returned status. Refs #77
This commit is contained in:
parent
71da0a51d8
commit
2ac4391edf
|
@ -103,13 +103,12 @@ class BuildList < ActiveRecord::Base
|
|||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def publish
|
||||
return false unless can_publish?
|
||||
|
||||
BuildServer.publish_container bs_id
|
||||
self.update_attribute(:status, BUILD_PUBLISHED)
|
||||
#self.destroy # self.delete
|
||||
has_published = BuildServer.publish_container bs_id
|
||||
update_attribute(:status, BUILD_PUBLISHED) if has_published == 0
|
||||
|
||||
return has_published == 0
|
||||
end
|
||||
|
||||
def can_publish?
|
||||
|
@ -119,7 +118,7 @@ class BuildList < ActiveRecord::Base
|
|||
def cancel
|
||||
has_canceled = BuildServer.delete_build_list bs_id
|
||||
update_attribute(:status, BUILD_CANCELED) if has_canceled == 0
|
||||
|
||||
|
||||
return has_canceled == 0
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue