Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions runbot/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
'data/runbot_data.xml',
'data/runbot_error_regex_data.xml',
'data/website_data.xml',
'data/runbot_config_parameters.xml',
"data/dockerfile_binaural.xml",

'security/runbot_security.xml',
'security/ir.model.access.csv',
Expand Down
82 changes: 82 additions & 0 deletions runbot/data/dockerfile_binaural.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<t t-name="runbot.docker_base">
<t t-set="default"
t-value="{from': 'ubuntu:jammy','odoo_branch': '17.0','chrome_source': 'google','chrome_version': '90.0.4430.93-1','node_packages': 'rtlcss es-check eslint','node_version': '15','psql_version': '12','wkhtml_url': 'https://github.com/wkhtmltopdf/wkhtmltopdf/releases/download/0.12.5/wkhtmltox_0.12.5-1.buster_amd64.deb','chrome': true,'phantom': false,'do_requirements': true,'python_version': 'python3','deb_packages_python': 'git python3 python3-dbfread python3-dev python3-pip python3-setuptools python3-wheel python3-markdown python3-mock python3-cffi python3-websocket libpq-dev','deb_package_default': 'npm apt-transport-https build-essential ca-certificates curl ffmpeg file fonts-freefont-ttf fonts-noto-cjk gawk gnupg gsfonts libldap2-dev libjpeg62-dev libsasl2-dev libxslt1-dev lsb-release node-less ocrmypdf sed sudo unzip xfonts-75dpi zip zlib1g-dev','additional_pip': 'google_auth xmlsec pyjwt zeep ebaysdk==2.1.5 pdf417gen==0.7.1','runbot_pip': 'coverage==4.5.4 astroid==2.4.2 pylint==2.5.0 flamegraph'}" />

<t t-set="values" t-value="default" />

<t t-set="dummy" t-value="values.update(custom_values)" t-if="custom_values" />

<t t-call="runbot.docker_from" />

<t t-call="runbot.docker_install_debs">
<t t-set="deb_packages" t-value="values['deb_package_default']" />
</t>

<t t-call="runbot.docker_install_debs">
<t t-set="deb_packages" t-value="values['deb_packages_python']" />
</t>

<t t-out="0" /><!-- custom content from caller t-call -->

<t t-call="runbot.docker_install_wkhtml" />
<!-- <t t-call="runbot.docker_install_nodejs"/> -->
<t t-call="runbot.docker_install_node_packages" />
<t t-call="runbot.docker_install_flamegraph" />
<!-- <t t-call="runbot.docker_install_odoo_debs"/> -->
<t t-call="runbot.docker_install_runbot_python_requirements" />
<t t-call="runbot.docker_install_psql" />

<!--
<t t-if="values['chrome']" t-call="runbot.docker_install_chrome"/>
-->

<t t-if="values['phantom']" t-call="runbot.docker_install_phantomjs" />

<t t-if="values['do_requirements']" t-call="runbot.docker_install_odoo_python_requirements" />
</t>

<t t-name="runbot.docker_install_debs">
RUN set -x ; \
apt-get update \
&amp;&amp; DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends <t t-esc="deb_packages or values['deb_packages']"/>
&amp;&amp; rm -rf /var/lib/apt/lists/*
</t>

<t t-name="runbot.docker_install_nodejs">
<t t-set="node_version" t-value="node_version or '15'"/>
# Install nodejs
RUN curl -sSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - \
&amp;&amp; echo ""deb https://deb.nodesource.com/node_<t t-esc="values['node_version']"/>.x `lsb_release -c -s` main"" &gt; /etc/apt/sources.list.d/nodesource.list \
&amp;&amp; apt-get update \
&amp;&amp; apt-get install -y nodejs
</t>

<t t-name="runbot.docker_install_node_packages">
RUN npm install -g <t t-esc="values['node_packages']"/>
</t>

<t t-name="runbot.docker_install_flamegraph">
ADD https://raw.githubusercontent.com/brendangregg/FlameGraph/master/flamegraph.pl /usr/local/bin/flamegraph.pl
RUN chmod +rx /usr/local/bin/flamegraph.pl
</t>

<t t-name="runbot.docker_install_odoo_python_requirements">
ADD https://raw.githubusercontent.com/odoo/odoo/<t t-esc="values['odoo_branch']"/>/requirements.txt /root/requirements.txt
RUN <t t-esc="values['python_version']"/> -m pip install --no-cache-dir setuptools wheel &amp;&amp; \
<t t-esc="values['python_version']"/> -m pip install --no-cache-dir -r /root/requirements.txt &amp;&amp; \
<t t-esc="values['python_version']"/> -m pip install --no-cache-dir <t t-esc="values['additional_pip']"/>
</t>

<t t-name="runbot.docker_install_psql">
<t t-set="psql_version" t-value="psql_version or False"/>
RUN curl -sSL https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&amp;&amp; echo ""deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -s -c`-pgdg main"" &gt; /etc/apt/sources.list.d/pgclient.list \
&amp;&amp; apt-get update \
&amp;&amp; DEBIAN_FRONTEND=noninteractive apt-get install -y postgresql-client<t t-if="values['psql_version']">-</t><t t-esc="values['psql_version']"/> \
&amp;&amp; rm -rf /var/lib/apt/lists/*
</t>


</odoo>
92 changes: 92 additions & 0 deletions runbot/data/runbot_config_parameters.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<odoo>
<data noupdate="1">
<!-- Enteros -->
<record id="runbot_config_workers" model="ir.config_parameter">
<field name="key">runbot.runbot_workers</field>
<field name="value">4</field>
</record>
<record id="runbot_config_running_max" model="ir.config_parameter">
<field name="key">runbot.runbot_running_max</field>
<field name="value">10</field>
</record>
<record id="runbot_config_timeout" model="ir.config_parameter">
<field name="key">runbot.runbot_timeout</field>
<field name="value">3600</field>
</record>
<record id="runbot_config_starting_port" model="ir.config_parameter">
<field name="key">runbot.runbot_starting_port</field>
<field name="value">2000</field>
</record>
<record id="runbot_config_max_age" model="ir.config_parameter">
<field name="key">runbot.runbot_max_age</field>
<field name="value">30</field>
</record>
<record id="runbot_config_update_frequency" model="ir.config_parameter">
<field name="key">runbot.runbot_update_frequency</field>
<field name="value">300</field>
</record>

<!-- Flotantes -->
<record id="runbot_config_containers_memory" model="ir.config_parameter">
<field name="key">runbot.runbot_containers_memory</field>
<field name="value">4.0</field>
</record>
<record id="runbot_config_containers_cpus" model="ir.config_parameter">
<field name="key">runbot.runbot_containers_cpus</field>
<field name="value">0.0</field>
</record>

<!-- Booleanos -->
<record id="runbot_config_do_fetch" model="ir.config_parameter">
<field name="key">runbot.runbot_do_fetch</field>
<field name="value">True</field>
</record>

<record id="runbot_config_do_schedule" model="ir.config_parameter">
<field name="key">runbot.runbot_do_schedule</field>
<field name="value">True</field>
</record>

<record id="runbot_config_disable_host_on_fetch_failure" model="ir.config_parameter">
<field name="value">False</field>
</record>

<!-- Texto y Chars -->
<record id="runbot_config_logdb_name" model="ir.config_parameter">
<field name="key">runbot.logdb_name</field>
<field name="value">runbot_logs</field>
</record>
<record id="runbot_config_template" model="ir.config_parameter">
<field name="key">runbot.template</field>
<field name="value">template1</field>
</record>
<record id="runbot_config_message" model="ir.config_parameter">
<field name="key">runbot.message</field>
<field name="value"><![CDATA[Servicio en mantenimiento - Vuelva pronto]]></field>
</record>
<record id="runbot_config_default_odoorc" model="ir.config_parameter">
<field name="key">runbot.default_odoorc</field>
<field name="value"><![CDATA[admin_passwd = superadmin_secret
db_host = localhost
db_port = 5432]]>

</field>
</record>
<record id="runbot_config_upgrade_exception_message" model="ir.config_parameter">
<field name="key">runbot.upgrade_exception_message</field>
<field name="value"><![CDATA[Se ha detectado un problema durante la actualización]]></field>
</record>
<record id="runbot_config_is_base_regex" model="ir.config_parameter">
<field name="key">runbot.is_base_regex</field>
<field name="value">^base:.*</field>
</record>
<record id="runbot_config_forwardport_author" model="ir.config_parameter">
<field name="key">runbot.forwardport_author</field>
<field name="value">Runbot &lt;runbot@example.com&gt;</field>
</record>
<record id="runbot_config_organisation" model="ir.config_parameter">
<field name="key">runbot.organisation</field>
<field name="value">MyOrg</field>
</record>
</data>
</odoo>
19 changes: 8 additions & 11 deletions runbot/data/runbot_data.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,17 @@
<data noupdate="1">
<record model="ir.config_parameter" id="runbot.runbot_upgrade_exception_message">
<field name="key">runbot.runbot_upgrade_exception_message</field>
<field name="value">Upgrade exception [#{exception.id}]({base_url}/web/#id={exception.id}&amp;view_type=form&amp;model=runbot.upgrade.exception) added\
{exception.elements}
<field name="value">Upgrade exception
[#{exception.id}]({base_url}/web/#id={exception.id}&amp;view_type=form&amp;model=runbot.upgrade.exception)
added\
{exception.elements}
</field>
</record>

<record model="ir.config_parameter" id="runbot.runbot_default_odoorc">
<field name="key">runbot.runbot_default_odoorc</field>
<field name="value">[options]
admin_passwd=running_master_password</field>
admin_passwd=running_master_password</field>
</record>

<record model="ir.config_parameter" id="runbot.runbot_default_logdb_name">
Expand All @@ -37,11 +39,6 @@ admin_passwd=running_master_password</field>

</data>

<record model="ir.config_parameter" id="runbot.runbot_disable_host_on_fetch_failure">
<field name="key">runbot.runbot_disable_host_on_fetch_failure</field>
<field name="value"></field>
</record>

<record model="ir.config_parameter" id="runbot.runbot_dockerfile_public_by_default">
<field name="key">runbot.runbot_dockerfile_public_by_default</field>
<field name="value"></field>
Expand Down Expand Up @@ -100,12 +97,12 @@ admin_passwd=running_master_password</field>

<record id="ir_cron_runbot" model="ir.cron">
<field name="name">Runbot</field>
<field name="active" eval="False"/>
<field name="active" eval="False" />
<field name="interval_number">10</field>
<field name="interval_type">seconds</field>
<field name="numbercall">-1</field>
<field name="doall" eval="False"/>
<field name="model_id" ref="model_runbot_runbot"/>
<field name="doall" eval="False" />
<field name="model_id" ref="model_runbot_runbot" />
<field name="code">model._cron()</field>
<field name="state">code</field>
</record>
Expand Down