====={{{ "=" * project.name|length }}}
Odoo {{{ project.name|capitalize }}}
====={{{ "=" * project.name|length }}}

.. contents::

Development environment howto
=============================

Initialize virtualenv
---------------------

create and activate virtualenv, possibly with virtualenvwrapper's
``mkvirtualenv odoo-{{{ project.name }}} -a . --python=$(which {{{ python_version }}})``

To save some time copy Odoo {{{ odoo.series }}} sources in src/odoo,
and do ``git clean -ffdx`` in src/odoo.

Install everything
------------------

.. code:: bash

   pip install --src src -r requirements.txt -e .

Only when there is a need to refresh the frozen dependencies,
review ``gitaggregate.yaml`` and ``requirements.txt.in``, then
run:

.. code:: bash

   gitaggregate -c gitaggregate.yaml -p
   rmvirtualenv odoo-{{{ project.name }}}
   mkvirtualenv odoo-{{{ project.name }}} -a . --python=$(which {{{ python_version }}})
   pip install --src src --pre -r requirements.txt.in
   ./freeze.sh
   git commit requirements.txt

Run
---

{{% if odoo.series in ['8.0', '9.0'] %}}
   odoo-autodiscover.py
{{% else %}}
   odoo
{{% endif %}}

Release
-------

First make sure you have been testing using the correct dependencies by
running ``./freeze.sh`` and checking there is no change in ``requirements.txt``.

To release using gitlab-ci
.........................

- run acsoo tag, the deploy to the test environment will be automatic, and
  gitlab will show a button on the pipeline to deploy to production.

To release manually
...................

- update version in ``acsoo.cfg`` and ``{{{ project.name }}}_all/__{{% if odoo.series in ['8.0', '9.0'] %}}openerp{{% else %}}manifest{{% endif %}}__.py``
- commit everything
- run ``acsoo release``

At that point the resulting wheel files in ``./release`` contain all the
code to be deployed.
