mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot: adapt for odoo 15.0
This commit is contained in:
parent
78f050b132
commit
3071f5a6db
@ -1,2 +1,2 @@
|
|||||||
matplotlib==3.1.2
|
matplotlib==3.5.0
|
||||||
unidiff
|
unidiff
|
||||||
|
@ -36,8 +36,6 @@
|
|||||||
'templates/nginx.xml',
|
'templates/nginx.xml',
|
||||||
'templates/build_error.xml',
|
'templates/build_error.xml',
|
||||||
|
|
||||||
'views/assets.xml',
|
|
||||||
|
|
||||||
'views/branch_views.xml',
|
'views/branch_views.xml',
|
||||||
'views/build_error_views.xml',
|
'views/build_error_views.xml',
|
||||||
'views/build_views.xml',
|
'views/build_views.xml',
|
||||||
@ -59,4 +57,11 @@
|
|||||||
'views/menus.xml',
|
'views/menus.xml',
|
||||||
],
|
],
|
||||||
'license': 'LGPL-3',
|
'license': 'LGPL-3',
|
||||||
|
|
||||||
|
'assets': {
|
||||||
|
'web.assets_backend': [
|
||||||
|
'runbot/static/src/js/json_field.js',
|
||||||
|
],
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ def route(routes, **kw):
|
|||||||
response.qcontext['current_path'] = request.httprequest.full_path
|
response.qcontext['current_path'] = request.httprequest.full_path
|
||||||
response.qcontext['refresh'] = refresh
|
response.qcontext['refresh'] = refresh
|
||||||
response.qcontext['filter_mode'] = filter_mode
|
response.qcontext['filter_mode'] = filter_mode
|
||||||
response.qcontext['default_category'] = request.env['ir.model.data'].xmlid_to_res_id('runbot.default_category')
|
response.qcontext['default_category'] = request.env['ir.model.data']._xmlid_to_res_id('runbot.default_category')
|
||||||
response.qcontext['qu'] = QueryURL('/runbot/%s' % (slug(project)), path_args=['search'], search=search, refresh=refresh)
|
response.qcontext['qu'] = QueryURL('/runbot/%s' % (slug(project)), path_args=['search'], search=search, refresh=refresh)
|
||||||
if 'title' not in response.qcontext:
|
if 'title' not in response.qcontext:
|
||||||
response.qcontext['title'] = 'Runbot %s' % project.name or ''
|
response.qcontext['title'] = 'Runbot %s' % project.name or ''
|
||||||
@ -152,7 +152,7 @@ class Runbot(Controller):
|
|||||||
query.limit=40
|
query.limit=40
|
||||||
bundles = env['runbot.bundle'].browse(query)
|
bundles = env['runbot.bundle'].browse(query)
|
||||||
|
|
||||||
category_id = int(request.httprequest.cookies.get('category') or 0) or request.env['ir.model.data'].xmlid_to_res_id('runbot.default_category')
|
category_id = int(request.httprequest.cookies.get('category') or 0) or request.env['ir.model.data']._xmlid_to_res_id('runbot.default_category')
|
||||||
|
|
||||||
trigger_display = request.httprequest.cookies.get('trigger_display_%s' % project.id, None)
|
trigger_display = request.httprequest.cookies.get('trigger_display_%s' % project.id, None)
|
||||||
if trigger_display is not None:
|
if trigger_display is not None:
|
||||||
|
@ -154,9 +154,9 @@ class BuildResult(models.Model):
|
|||||||
trigger_id = fields.Many2one('runbot.trigger', related='params_id.trigger_id', store=True, index=True)
|
trigger_id = fields.Many2one('runbot.trigger', related='params_id.trigger_id', store=True, index=True)
|
||||||
|
|
||||||
# state machine
|
# state machine
|
||||||
global_state = fields.Selection(make_selection(state_order), string='Status', compute='_compute_global_state', store=True)
|
global_state = fields.Selection(make_selection(state_order), string='Status', compute='_compute_global_state', store=True, recursive=True)
|
||||||
local_state = fields.Selection(make_selection(state_order), string='Build Status', default='pending', required=True, index=True)
|
local_state = fields.Selection(make_selection(state_order), string='Build Status', default='pending', required=True, index=True)
|
||||||
global_result = fields.Selection(make_selection(result_order), string='Result', compute='_compute_global_result', store=True)
|
global_result = fields.Selection(make_selection(result_order), string='Result', compute='_compute_global_result', store=True, recursive=True)
|
||||||
local_result = fields.Selection(make_selection(result_order), string='Build Result')
|
local_result = fields.Selection(make_selection(result_order), string='Build Result')
|
||||||
triggered_result = fields.Selection(make_selection(result_order), string='Triggered Result') # triggered by db only
|
triggered_result = fields.Selection(make_selection(result_order), string='Triggered Result') # triggered by db only
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@ class Bundle(models.Model):
|
|||||||
base_id = fields.Many2one('runbot.bundle', 'Base bundle', compute='_compute_base_id', store=True)
|
base_id = fields.Many2one('runbot.bundle', 'Base bundle', compute='_compute_base_id', store=True)
|
||||||
to_upgrade = fields.Boolean('To upgrade', compute='_compute_to_upgrade', store=True, index=False)
|
to_upgrade = fields.Boolean('To upgrade', compute='_compute_to_upgrade', store=True, index=False)
|
||||||
|
|
||||||
version_id = fields.Many2one('runbot.version', 'Version', compute='_compute_version_id', store=True)
|
version_id = fields.Many2one('runbot.version', 'Version', compute='_compute_version_id', store=True, recursive=True)
|
||||||
version_number = fields.Char(related='version_id.number', store=True, index=True)
|
version_number = fields.Char(related='version_id.number', store=True, index=True)
|
||||||
|
|
||||||
previous_major_version_base_id = fields.Many2one('runbot.bundle', 'Previous base bundle', compute='_compute_relations_base_id')
|
previous_major_version_base_id = fields.Many2one('runbot.bundle', 'Previous base bundle', compute='_compute_relations_base_id')
|
||||||
@ -129,7 +129,7 @@ class Bundle(models.Model):
|
|||||||
def _compute_last_batchs(self):
|
def _compute_last_batchs(self):
|
||||||
batch_ids = defaultdict(list)
|
batch_ids = defaultdict(list)
|
||||||
if self.ids:
|
if self.ids:
|
||||||
category_id = self.env.context.get('category_id', self.env['ir.model.data'].xmlid_to_res_id('runbot.default_category'))
|
category_id = self.env.context.get('category_id', self.env['ir.model.data']._xmlid_to_res_id('runbot.default_category'))
|
||||||
self.env.cr.execute("""
|
self.env.cr.execute("""
|
||||||
SELECT
|
SELECT
|
||||||
id
|
id
|
||||||
@ -161,7 +161,7 @@ class Bundle(models.Model):
|
|||||||
# self.env['runbot.batch'].flush()
|
# self.env['runbot.batch'].flush()
|
||||||
for bundle in self:
|
for bundle in self:
|
||||||
bundle.last_done_batch = False
|
bundle.last_done_batch = False
|
||||||
category_id = self.env.context.get('category_id', self.env['ir.model.data'].xmlid_to_res_id('runbot.default_category'))
|
category_id = self.env.context.get('category_id', self.env['ir.model.data']._xmlid_to_res_id('runbot.default_category'))
|
||||||
self.env.cr.execute("""
|
self.env.cr.execute("""
|
||||||
SELECT
|
SELECT
|
||||||
id
|
id
|
||||||
|
@ -37,7 +37,7 @@ class Dockerfile(models.Model):
|
|||||||
def _compute_dockerfile(self):
|
def _compute_dockerfile(self):
|
||||||
for rec in self:
|
for rec in self:
|
||||||
try:
|
try:
|
||||||
res = rec.template_id._render().decode() if rec.template_id else ''
|
res = rec.template_id._render() if rec.template_id else ''
|
||||||
rec.dockerfile = re.sub(r'^\s*$', '', res, flags=re.M).strip()
|
rec.dockerfile = re.sub(r'^\s*$', '', res, flags=re.M).strip()
|
||||||
except QWebException:
|
except QWebException:
|
||||||
rec.dockerfile = ''
|
rec.dockerfile = ''
|
||||||
|
@ -117,6 +117,6 @@ access_runbot_codeowner_user,runbot_codeowner_user,runbot.model_runbot_codeowner
|
|||||||
|
|
||||||
access_runbot_commit_export_admin,runbot_commit_export_admin,runbot.model_runbot_commit_export,runbot.group_runbot_admin,1,1,1,1
|
access_runbot_commit_export_admin,runbot_commit_export_admin,runbot.model_runbot_commit_export,runbot.group_runbot_admin,1,1,1,1
|
||||||
|
|
||||||
access_runbot_trigger_custom_wizard,access_runbot_trigger_custom_wizard,model_runbot_trigger_custom_wizard,runbot.group_runbot_admin,1,1,1,1
|
access_runbot_trigger_custom_wizard,access_runbot_trigger_custom_wizard,model_runbot_trigger_custom_wizard,runbot.group_runbot_admin,1,1,1,1
|
||||||
|
|
||||||
access_runbot_build_stat_regex_wizard,access_runbot_build_stat_regex_wizard,model_runbot_build_stat_regex_wizard,runbot.group_runbot_admin,1,1,1,1
|
access_runbot_build_stat_regex_wizard,access_runbot_build_stat_regex_wizard,model_runbot_build_stat_regex_wizard,runbot.group_runbot_admin,1,1,1,1
|
||||||
|
|
@ -143,7 +143,7 @@
|
|||||||
<div t-attf-class="alert alert-{{logclass}}">
|
<div t-attf-class="alert alert-{{logclass}}">
|
||||||
<b t-esc="log.level"/>
|
<b t-esc="log.level"/>
|
||||||
--
|
--
|
||||||
<t t-raw="log._markdown()"/>
|
<t t-out="log._markdown()"/>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
|
@ -87,7 +87,7 @@
|
|||||||
|
|
||||||
<t t-if="build.description">
|
<t t-if="build.description">
|
||||||
<b>Description:</b>
|
<b>Description:</b>
|
||||||
<t t-raw="build.md_description"/>
|
<t t-out="build.md_description"/>
|
||||||
<br/>
|
<br/>
|
||||||
</t>
|
</t>
|
||||||
|
|
||||||
@ -184,7 +184,7 @@
|
|||||||
<t t-esc="child.id"/>
|
<t t-esc="child.id"/>
|
||||||
</a>
|
</a>
|
||||||
<t t-if="child.description">
|
<t t-if="child.description">
|
||||||
<t t-raw="child.md_description" />
|
<t t-out="child.md_description" />
|
||||||
</t>
|
</t>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
with config
|
with config
|
||||||
@ -283,7 +283,7 @@
|
|||||||
<t t-esc="message[2]"/>
|
<t t-esc="message[2]"/>
|
||||||
</t>
|
</t>
|
||||||
</t>
|
</t>
|
||||||
<t t-elif="l.type == 'markdown'" t-raw="l._markdown()"/>
|
<t t-elif="l.type == 'markdown'" t-out="l._markdown()"/>
|
||||||
<t t-else="">
|
<t t-else="">
|
||||||
<t t-if="'\n' not in l.message" t-esc="l.message"/>
|
<t t-if="'\n' not in l.message" t-esc="l.message"/>
|
||||||
<pre t-if="'\n' in l.message" style="margin:0;padding:0; border: none;"><t t-esc="l.message"/></pre>
|
<pre t-if="'\n' in l.message" style="margin:0;padding:0; border: none;"><t t-esc="l.message"/></pre>
|
||||||
@ -352,7 +352,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<t t-if="build.description">
|
<t t-if="build.description">
|
||||||
<t t-raw="build.md_description" />
|
<t t-out="build.md_description" />
|
||||||
</t>
|
</t>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
<b>Build: </b><a t-attf-href="/runbot/build/{{build.id}}"><t t-esc="build.id"/></a><br/>
|
<b>Build: </b><a t-attf-href="/runbot/build/{{build.id}}"><t t-esc="build.id"/></a><br/>
|
||||||
<t t-if="build.description">
|
<t t-if="build.description">
|
||||||
<b>Description:</b>
|
<b>Description:</b>
|
||||||
<t t-raw="build.md_description"/>
|
<t t-out="build.md_description"/>
|
||||||
<br/>
|
<br/>
|
||||||
</t>
|
</t>
|
||||||
<b>Date: </b><t t-esc="build.create_date" /><br/>
|
<b>Date: </b><t t-esc="build.create_date" /><br/>
|
||||||
|
@ -135,7 +135,7 @@ RUN <t t-esc="values['python_version']"/> -m pip install --no-cache-dir setuptoo
|
|||||||
<t t-call="runbot.docker_install_debs">
|
<t t-call="runbot.docker_install_debs">
|
||||||
<t t-set="deb_packages" t-value="values['deb_packages_python']"/>
|
<t t-set="deb_packages" t-value="values['deb_packages_python']"/>
|
||||||
</t>
|
</t>
|
||||||
<t t-raw="0"/><!-- custom content from caller t-call-->
|
<t t-out="0"/><!-- custom content from caller t-call-->
|
||||||
<t t-call="runbot.docker_install_wkhtml"/>
|
<t t-call="runbot.docker_install_wkhtml"/>
|
||||||
<t t-call="runbot.docker_install_nodejs"/>
|
<t t-call="runbot.docker_install_nodejs"/>
|
||||||
<t t-call="runbot.docker_install_node_packages"/>
|
<t t-call="runbot.docker_install_node_packages"/>
|
||||||
|
@ -54,14 +54,14 @@ server {
|
|||||||
<t t-foreach="builds" t-as="build">
|
<t t-foreach="builds" t-as="build">
|
||||||
server {
|
server {
|
||||||
listen 8080;
|
listen 8080;
|
||||||
server_name ~^<t t-raw="re_escape(build.dest)"/>(-[a-z0-9_]+)?\.<t t-raw="re_escape(fqdn)"/>$;
|
server_name ~^<t t-out="re_escape(build.dest)"/>(-[a-z0-9_]+)?\.<t t-esc="re_escape(fqdn)"/>$;
|
||||||
location / { proxy_pass http://127.0.0.1:<t t-esc="build.port"/>; }
|
location / { proxy_pass http://127.0.0.1:<t t-esc="build.port"/>; }
|
||||||
location /longpolling { proxy_pass http://127.0.0.1:<t t-esc="build.port + 1"/>; }
|
location /longpolling { proxy_pass http://127.0.0.1:<t t-esc="build.port + 1"/>; }
|
||||||
}
|
}
|
||||||
</t>
|
</t>
|
||||||
server {
|
server {
|
||||||
listen 8080;
|
listen 8080;
|
||||||
server_name ~.+\.<t t-raw="re_escape(fqdn)"/>$;
|
server_name ~.+\.<t t-out="re_escape(fqdn)"/>$;
|
||||||
location / { return 404; }
|
location / { return 404; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<t t-raw="0"/>
|
<t t-out="0"/>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
</template>
|
</template>
|
||||||
@ -126,12 +126,12 @@
|
|||||||
</li>
|
</li>
|
||||||
</t>
|
</t>
|
||||||
</ul>
|
</ul>
|
||||||
<t t-raw="nav_form or ''">
|
<t t-out="nav_form or ''">
|
||||||
</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
</header>
|
</header>
|
||||||
<t t-raw="0"/>
|
<t t-out="0"/>
|
||||||
</body>
|
</body>
|
||||||
</xpath>
|
</xpath>
|
||||||
</template>
|
</template>
|
||||||
|
@ -1,7 +0,0 @@
|
|||||||
<odoo>
|
|
||||||
<template id="runbot_json_field" inherit_id="web.assets_backend" active="True">
|
|
||||||
<xpath expr="." position="inside">
|
|
||||||
<script type="text/javascript" src="/runbot/static/src/js/json_field.js"></script>
|
|
||||||
</xpath>
|
|
||||||
</template>
|
|
||||||
</odoo>
|
|
@ -311,7 +311,7 @@
|
|||||||
<h3 t-if="not entry_first" t-esc="entry"/>
|
<h3 t-if="not entry_first" t-esc="entry"/>
|
||||||
<ul>
|
<ul>
|
||||||
<li t-foreach="sorted(entry_value)" t-as="item">
|
<li t-foreach="sorted(entry_value)" t-as="item">
|
||||||
<t t-raw="item"/>
|
<t t-out="item"/>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</section>
|
</section>
|
||||||
@ -436,4 +436,3 @@
|
|||||||
</t>
|
</t>
|
||||||
</template>
|
</template>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user