mirror of
https://github.com/odoo/runbot.git
synced 2025-03-15 23:45:44 +07:00
killpg to kill all workers, rebuild only on last build
This commit is contained in:
parent
0d8df5ea0b
commit
73aef7f083
@ -93,12 +93,6 @@ def run(l, env=None):
|
||||
log("run", rc=rc)
|
||||
return rc
|
||||
|
||||
def kill(pid, sig=signal.SIGKILL):
|
||||
try:
|
||||
os.kill(pid, sig)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
def now():
|
||||
return time.strftime(openerp.tools.DEFAULT_SERVER_DATETIME_FORMAT)
|
||||
|
||||
@ -726,7 +720,10 @@ class runbot_build(osv.osv):
|
||||
def kill(self, cr, uid, ids, context=None):
|
||||
for build in self.browse(cr, uid, ids, context=context):
|
||||
build.logger('killing %s', build.pid)
|
||||
kill(build.pid)
|
||||
try:
|
||||
os.killpg(build.pid, signal.SIGKILL)
|
||||
except OSError:
|
||||
pass
|
||||
build.write({'state':'done'})
|
||||
cr.commit()
|
||||
self.pg_dropdb(cr, uid, "%s-base" % build.dest)
|
||||
|
@ -227,7 +227,7 @@
|
||||
<li><a t-attf-href="http://{{bu.domain}}/?db={{bu.dest}}-base">Connect base <i class="fa fa-sign-in"></i></a></li>
|
||||
<li><a t-attf-href="http://{{bu.domain}}/">Connect <i class="fa fa-sign-in"></i></a></li>
|
||||
</t>
|
||||
<li t-if="bu.state in ['done','running']">
|
||||
<li t-if="bu.state in ['done','running'] and bu_index==0">
|
||||
<a t-attf-href="/runbot/build/#{bu.id}/force">Rebuild <i class="fa fa-refresh"/></a>
|
||||
</li>
|
||||
<li t-if="bu.state!='testing'" class="divider"></li>
|
||||
@ -342,7 +342,6 @@
|
||||
<t t-if="bu.state in ['running','done'] and bu.result == 'ko'"><t t-set="klass">danger</t></t>
|
||||
<t t-if="bu.state in ['running','done'] and bu.result == 'ok'"><t t-set="klass">success</t></t>
|
||||
<td t-attf-class="{{klass}}">
|
||||
<small>
|
||||
<t t-call="runbot.build_button"><t t-set="klass">btn-group-sm</t></t>
|
||||
<t t-if="bu.subject">
|
||||
<span t-esc="bu.subject[:32] + ('...' if bu.subject[32:] else '') " t-att-title="bu.subject"/>
|
||||
@ -353,7 +352,6 @@
|
||||
</t>
|
||||
<small><t t-esc="bu.dest"/></small><br/>
|
||||
<t t-call="runbot.build_name"/>
|
||||
</small>
|
||||
</td>
|
||||
</t>
|
||||
</tr>
|
||||
@ -393,6 +391,7 @@
|
||||
<div class="btn-group">
|
||||
<t t-call="runbot.build_button">
|
||||
<t t-set="bu" t-value="build"/>
|
||||
<t t-set="bu_index" t-value="-1"/>
|
||||
<t t-set="klass" t-value="''"/>
|
||||
</t>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user