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)
|
log("run", rc=rc)
|
||||||
return rc
|
return rc
|
||||||
|
|
||||||
def kill(pid, sig=signal.SIGKILL):
|
|
||||||
try:
|
|
||||||
os.kill(pid, sig)
|
|
||||||
except OSError:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def now():
|
def now():
|
||||||
return time.strftime(openerp.tools.DEFAULT_SERVER_DATETIME_FORMAT)
|
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):
|
def kill(self, cr, uid, ids, context=None):
|
||||||
for build in self.browse(cr, uid, ids, context=context):
|
for build in self.browse(cr, uid, ids, context=context):
|
||||||
build.logger('killing %s', build.pid)
|
build.logger('killing %s', build.pid)
|
||||||
kill(build.pid)
|
try:
|
||||||
|
os.killpg(build.pid, signal.SIGKILL)
|
||||||
|
except OSError:
|
||||||
|
pass
|
||||||
build.write({'state':'done'})
|
build.write({'state':'done'})
|
||||||
cr.commit()
|
cr.commit()
|
||||||
self.pg_dropdb(cr, uid, "%s-base" % build.dest)
|
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}}/?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>
|
<li><a t-attf-href="http://{{bu.domain}}/">Connect <i class="fa fa-sign-in"></i></a></li>
|
||||||
</t>
|
</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>
|
<a t-attf-href="/runbot/build/#{bu.id}/force">Rebuild <i class="fa fa-refresh"/></a>
|
||||||
</li>
|
</li>
|
||||||
<li t-if="bu.state!='testing'" class="divider"></li>
|
<li t-if="bu.state!='testing'" class="divider"></li>
|
||||||
@ -342,18 +342,16 @@
|
|||||||
<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 == '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>
|
<t t-if="bu.state in ['running','done'] and bu.result == 'ok'"><t t-set="klass">success</t></t>
|
||||||
<td t-attf-class="{{klass}}">
|
<td t-attf-class="{{klass}}">
|
||||||
<small>
|
<t t-call="runbot.build_button"><t t-set="klass">btn-group-sm</t></t>
|
||||||
<t t-call="runbot.build_button"><t t-set="klass">btn-group-sm</t></t>
|
<t t-if="bu.subject">
|
||||||
<t t-if="bu.subject">
|
<span t-esc="bu.subject[:32] + ('...' if bu.subject[32:] else '') " t-att-title="bu.subject"/>
|
||||||
<span t-esc="bu.subject[:32] + ('...' if bu.subject[32:] else '') " t-att-title="bu.subject"/>
|
<br/>
|
||||||
<br/>
|
</t>
|
||||||
</t>
|
<t t-id="bu.author">
|
||||||
<t t-id="bu.author">
|
<t t-esc="bu.author"/><br/>
|
||||||
<t t-esc="bu.author"/><br/>
|
</t>
|
||||||
</t>
|
<small><t t-esc="bu.dest"/></small><br/>
|
||||||
<small><t t-esc="bu.dest"/></small><br/>
|
<t t-call="runbot.build_name"/>
|
||||||
<t t-call="runbot.build_name"/>
|
|
||||||
</small>
|
|
||||||
</td>
|
</td>
|
||||||
</t>
|
</t>
|
||||||
</tr>
|
</tr>
|
||||||
@ -393,6 +391,7 @@
|
|||||||
<div class="btn-group">
|
<div class="btn-group">
|
||||||
<t t-call="runbot.build_button">
|
<t t-call="runbot.build_button">
|
||||||
<t t-set="bu" t-value="build"/>
|
<t t-set="bu" t-value="build"/>
|
||||||
|
<t t-set="bu_index" t-value="-1"/>
|
||||||
<t t-set="klass" t-value="''"/>
|
<t t-set="klass" t-value="''"/>
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user