Commit Graph

216 Commits

Author SHA1 Message Date
hugues de keyzer
560f4f5485 publish docker ports only when needed 2024-04-30 15:10:43 +02:00
Rémy Taymans
0a0c763a49 Merge branch 'allow-minus-in-database-names' into 'main'
allow hyphen-minus character in database names

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!70
2024-04-12 10:32:13 +00:00
hugues de keyzer
bb2b3be3b4 allow hyphen-minus character in database names 2024-04-12 11:35:22 +02:00
hugues de keyzer
58bc87380d add database name to container name 2024-04-10 17:15:21 +02:00
hugues de keyzer
148aa5f89f add config file and modules file cli options
allow to provide a config file and a modules file option to use
different files than the default ones. this is useful when using the
same environment for different databases.
2024-04-10 15:32:29 +02:00
Rémy Taymans
f1cf0dac23 Apply all suggestion made by Rémy Taymans. 2024-03-23 21:59:12 +01:00
Sylvain LE GAL
a73de5f240 [REF] apply f-string to improve readability 2024-03-23 20:53:57 +01:00
Sylvain LE GAL
7b5f922c61 [REF] remove useless commented code 2024-03-23 20:51:18 +01:00
Sylvain LE GAL
853f37889c [FIX] 'CREATE DATABASE' is a command, not a request that requires result 2024-03-23 10:23:54 +01:00
Sylvain LE GAL
4a874957ed [REF] move postgres code into dedicated tools file 2024-03-23 10:16:32 +01:00
Sylvain LE GAL
a11d137eed [IMP] oow init : new option --postgresql-version 2024-03-22 20:30:43 +01:00
Rémy Taymans
567ffd4428 Merge branch 'ADD-restoredb' into 'main'
[ADD] restoredb function

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!40
2024-03-03 08:25:39 +00:00
Sylvain LE GAL
748d5a54f6 [ADD] restoredb function 2024-03-02 23:59:36 +01:00
Sylvain LE GAL
dbdf592990 [IMP] 'run' cli command. Add '--update-modules' option 2024-03-01 15:51:09 +01:00
Sylvain LE GAL
d890a460ea [IMP] Harmonize run and upgrade cli command. Allow to call command with argument --with-demo / --without-demo like in install-from-csv.
For that purpose, create a new decorator.
[REF] Change the default of install-from-csv to harmonize. (allways False)
2024-03-01 15:51:09 +01:00
Sylvain LE GAL
f75821c2bc [FIX] Do not crash silently, when a repos.yml file reference an empty addons folder.
Step to reproduce :
- run a V15 instance
- add a reference to 'OCA/geospatial' repo that doesn't contain any odoo module.
As a result, Odoo will exit with the following error:
    odoo-bin: error: option --addons-path: the path '/odoo_env/src/OCA/geospatial' is not a valid addons directory

To avoid such problem, and avoid to have to remove empty repository
(that could become non empty in the future, and contains some migrations scripts),
- we reimplement a version of the odoo function _is_addons_path (odoo/odoo/tools/config.py)
- we add an info log :
    Skipping addons path '.../src/env_15.0/src/OCA/geospatial'  because it doesn't contain any odoo module.
2024-03-01 13:47:26 +01:00
Rémy Taymans
30198392c5 [ADD] dropdb 2024-02-22 08:53:45 +01:00
LE GAL SYLVAIN
dea0bbd70c Merge branch 'fix-estimate-workload' into 'main'
[FIX] estimate-workload: wrong warning message

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!53
2024-02-08 09:51:34 +00:00
Rémy Taymans
25655d4b7a [FIX] install-from-csv: add with-demo option
Add a flag to specify if the database created by install-from-csv should
install demo data or not.

Fix #41
2024-02-07 17:25:56 +01:00
Rémy Taymans
2b0e359d4e [FIX] estimate-workload: wrong warning message
Previous syntax does not replace correctly the markers in the string.

Using an f-string fix this.

Before:
2024-02-06 10:47:02.303 | WARNING  | odoo_openupgrade_wizard.tools.tools_odoo_module:get_odoo_apps_url:359 - Error when trying to get %s: %s

After:
2024-02-07 10:51:11.964 | WARNING  | odoo_openupgrade_wizard.tools.tools_odoo_module:get_odoo_apps_url:356 - Error when trying to get https://apps.odoo.com/apps/modules/12.0/partner_contact_address/: Exceeded 30 redirects.
2024-02-07 11:15:23 +01:00
Rémy Taymans
38ac07c141 [FIX] getting url on apps.odoo.com
Fix #40
2024-02-05 16:14:06 +01:00
Rémy Taymans
d781709cb5 Fix 404 not found errors when using docker 2023-11-09 20:50:46 +01:00
Rémy Taymans
6a36c97ee4 Use last python image for linting
The linting check can be done on any docker image with the latest python
version.

This updates de pre-commit checks and fix file linting to conform to new
standards.
2023-11-09 17:02:24 +01:00
Rémy Taymans
690ab60699 Fix Dockerfile when using root on host
root user should not be used to create container and oow should not be
run as root.

But when running oow in a docker, then the default user of this docker
can be root.

This fix allow to link the odoo user in the odoo environment docker to
match a root user of the host docker.
2023-11-09 16:36:53 +01:00
Rémy Taymans
a3a8af9a70 Fix listing containers during removal of containers
Removing a container can take some time to be performed. Listing
containers when a container is currently being removed may cause errors.
Because listing container and filtering them by name requires to fetch
data from the container that is currently being removed.
2023-11-09 16:27:29 +01:00
Rémy Taymans
a0307847b9 Allow mocking the ODOO_RPC_URL for testing
Depending of the test environment, the url of the odoo container may
change.

Using pytest in a local shell, Odoo will be available at 0.0.0.0
address.

Using pytest in a docker-in-docker environment, the url for the Odoo
container will be exposed on a different address depending on the
configuration of the docker-in-docker environment.

The mock check whether the user has configured a différent URL for the
Odoo RPC calls, and set it accordingly using mock feature.

In the gitlab-ci, the ODOO_RPC_URL should be used to set the correct
address for the RPC calls.
2023-11-09 16:21:20 +01:00
LE GAL SYLVAIN
0c6110373a Merge branch 'FIX-copydb-add-copyfilestore' into 'main'
Finish copydb. (add copy of the filestore)

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!39
2023-07-18 08:55:41 +00:00
Sylvain LE GAL
7a31cc666d [FIX] copydb : add the copy of the filestore
[DOC] Add documentation section for the copydb function
2023-07-17 14:12:14 +02:00
Rémy Taymans
f143e218a0 (Also improve CI) 2023-07-13 14:24:20 +00:00
Simon
070143f3fe Wait for the container name to be truly freed before returning 2023-07-13 14:24:20 +00:00
Rémy Taymans
757cc19576 [FIX] dumpdb: error when using force 2023-07-12 08:35:20 +02:00
Rémy Taymans
debf57bac3 [ADD] dumpdb command 2023-07-12 08:32:57 +02:00
Sylvain LE GAL
8a79974232 [REF] Use f-string to make the code lighter
[FIX] execute_psql_command: make optional database argument working correctly
[FIX] execute_psql_command: avoid to have an error
2023-07-06 16:37:52 +02:00
Rémy Taymans
284417bb00 [ADD] psql command 2023-05-09 21:34:17 +02:00
Cyril Jeanneret
c5c4276a82 Fix image debian changed repo to archive 2023-04-26 06:45:19 +00:00
Rémy Taymans
40c54d2260 [FIX] missing newline in generated files
In a proper file each line end with a newline character, even the last
one.

Wrong file:

Using `write()` function does not add a newline character at the end of
the write. So writing a string in a file with `write()` leads to a file
like this:

```
line1\n
line2\n
lastline
```

Good file:

Using the `print()` command automatically ends the string with a newline
character. So that we ends with a proper file:
```
line1\n
line2\n
lastline\n
```

Also the with statement automatically closes the file at the end of the
block.
2023-03-17 08:54:44 +01:00
Rémy Taymans
15088c9d0f [FIX] config: indentation 2023-03-17 00:16:00 +01:00
Rémy Taymans
a04353b683 [ADD] estimate-workload: ignored module list 2023-03-16 23:26:45 +01:00
Rémy Taymans
9e0489f1f1 [FIX] upgrade: run pre_migration files 2023-02-28 09:43:54 +01:00
Rémy Taymans
7a2b19664d [FIX] error when killing container 2023-02-28 09:21:53 +01:00
Rémy Taymans
312e654e88 [IMP] estimate_workload: add time configuration 2023-01-27 17:30:50 +01:00
Rémy Taymans
a2423ec4f8 [IMP] estimate-workload: add total column in report 2023-01-18 19:50:29 +01:00
Rémy Taymans
e35aa8d804 Merge branch 'fix-repository_name-case-estimate-workload' into 'main'
[FIX] repository_name

Closes #30 and #24

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!26
2023-01-17 09:48:39 +00:00
Rémy Taymans
cfb0c8b65e [FIX] Typo in config file 2023-01-11 12:32:40 +01:00
Rémy Taymans
a5dcd8fdcc [IMP] module repository_name detection
Some repository may have multiples remotes. This tries to find the main
remote when possible.
2023-01-10 19:52:51 +01:00
Rémy Taymans
8c55892d53 [FIX] estimate-workload: not_found module not categorized 2023-01-10 19:51:20 +01:00
Rémy Taymans
9281d6b572 [FIX] repository_name case insensitive 2023-01-10 19:50:20 +01:00
Rémy Taymans
5777d9004f [IMP] docker-build: errors if no odoo_requirements file 2023-01-03 14:16:29 +01:00
Sylvain LE GAL
f7a198823a [REF] move lines in dockerfile to optimize image builds if python / debian requirements files changed 2023-01-03 10:41:42 +01:00
Sylvain LE GAL
eeb8c1dab2 [DOC] upgrade documentation, to explain Dockerfile creation (and current issues)
[ADD] 11.0 docker file : Add Dockerfile, based on https://raw.githubusercontent.com/odoo/odoo/11.0/setup/package.dfsrc
[FIX] 12.0 docker file : use correct Dockerfile, based on https://raw.githubusercontent.com/odoo/odoo/12.0/setup/package.dfsrc
[FIX] 13.0 docker file : use correct Dockerfile, based on https://raw.githubusercontent.com/odoo/odoo/13.0/setup/package.dfsrc
[FIX] 14.0 docker file : use correct Dockerfile, based on https://raw.githubusercontent.com/odoo/odoo/14.0/setup/package.dfsrc
[FIX] 15.0 docker file : use correct Dockerfile, based on https://raw.githubusercontent.com/odoo/odoo/15.0/setup/package.dfsrc
[FIX] 16.0 docker file : use correct Dockerfile, based on https://raw.githubusercontent.com/odoo/odoo/16.0/setup/package.dfsrc
2023-01-03 10:41:42 +01:00
Rémy Taymans
82da4bb3ba [FIX] estimate-workload: InvalidGitRepositoryError
For older Odoo version directories are named openerp.
2023-01-02 18:52:00 +01:00
Sylvain LE GAL
a56d9cdf0c [REF] trivial refacgtoring avoid to compute odoo_folder for each key in data.keys() 2022-11-10 20:52:40 +01:00
Sylvain LE GAL
ee8fb9bd1a [FIX] pull submodule : use str instead of Posix path 2022-11-10 20:23:58 +01:00
Rémy Taymans
2f5f1edaf0 Merge branch 'add-docker-odoo-16' into 'main'
[ADD] odoo 16.0 template

Closes #10

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!20
2022-10-13 20:02:05 +00:00
Rémy Taymans
95a6643d88 [ADD] odoo 16.0 template 2022-10-12 10:38:56 +02:00
Rémy Taymans
6d0d6f355e [IMP] documentation about odoo.conf
Close #9
2022-10-11 16:01:08 +02:00
Rémy Taymans
f3c9d3b533 [FIX] odoo.cfg to odoo.conf
Close issue #8
2022-10-11 14:39:38 +02:00
Sylvain LE GAL
4634def83f [IMP] use always the master branch of openupgradelib 2022-10-11 12:26:41 +02:00
Sylvain LE GAL
e63851cf9e [ADD][WIP] copydb (pseudo click-odoo function 2022-10-11 12:26:41 +02:00
Sylvain LE GAL
bdc9b606ec [IMP] Add postgresql custom configuration ; [ADD] extra setting into odoo_default_company key. (in config.yml file) ; [ADD] odoo_rpc_timeout extra settings ; [FIX] restore call to custom odoo.cfg file 2022-10-11 12:26:41 +02:00
Sylvain LE GAL
531978eb00 [ADD] repos url git log! 2022-07-12 00:55:36 +02:00
Sylvain LE GAL
d7a576890a [IMP] prune postgres container 2022-07-11 16:46:08 +02:00
Sylvain LE GAL
c924103fa0 [IMP] add local_user_id in build call. 2022-07-11 15:15:22 +02:00
Sylvain LE GAL
11c43cf8b2 [IMP] description in config.yml file 2022-07-11 13:57:13 +02:00
Sylvain LE GAL
be74ce5bab [REF] Set correct dockerfile, based on odoo/debian ones. (for 12 to 15) 2022-07-11 13:43:55 +02:00
Sylvain LE GAL
590f92a1c9 [REM] fucking inadapted docker images 2022-07-11 00:15:56 +02:00
Sylvain LE GAL
acb02fd9cc wip de chez wip 2022-07-01 13:38:59 +02:00
Sylvain LE GAL
a964efd029 wip 2022-06-29 22:12:29 +02:00
Sylvain LE GAL
4500d9fe43 [REF] introduce exec_container command 2022-06-29 21:53:26 +02:00
Sylvain LE GAL
afcdeaa81d ADD a lot of logger to try to understand why it works locally and not on the CI 2022-06-29 21:16:27 +02:00
Sylvain LE GAL
a9f7fa3568 improve log 2022-06-29 21:03:06 +02:00
Sylvain LE GAL
798e27ab16 [IMP] add logger in execute_sql_file 2022-06-29 20:13:08 +02:00
Sylvain LE GAL
819ef6a417 [FIX] par exemple, introduire des bugs, c'est pas gentils 2022-06-29 18:02:21 +02:00
Sylvain LE GAL
80bd469095 [FIX] replace hardcoded 1000 value by os.getuid() 2022-06-29 17:52:58 +02:00
Sylvain LE GAL
4427470a41 various 2022-06-29 17:46:58 +02:00
Sylvain LE GAL
1261dfaa2f [REF] Add logger in test 2022-06-29 17:37:08 +02:00
Sylvain LE GAL
36db85e4b9 [ADD] Log if container fails during odoo execution 2022-06-29 17:17:17 +02:00
Sylvain LE GAL
424131e9b2 [REF] Remove bind fucking mounts (postgres) replaced by nice volumes 2022-06-29 16:28:48 +02:00
Sylvain LE GAL
7fca87bae7 [FIX] GREENIFY ALL THE TESTgit status! 2022-06-29 15:50:17 +02:00
Sylvain LE GAL
ae3619e766 [REF] replace click-odoo by calling shell command directly 2022-06-29 15:13:13 +02:00
Sylvain LE GAL
1ead68bef0 [REF] remove click-odoo that requires to import odoo that is a mess 2022-06-29 14:12:12 +02:00
Sylvain LE GAL
8035ba2871 [FIX] various test. Readd odoorpc in the requilrements.txt file to generate_module_analysis and add comments in the file 2022-06-29 11:25:29 +02:00
Sylvain LE GAL
01b2a94cb4 [FIX] do not crash if postgres container exists in a exited status 2022-06-29 10:58:27 +02:00
Sylvain LE GAL
db3d16e37c [IMP] make cli_05_execute_script_python_test working 2022-06-29 10:34:58 +02:00
Sylvain LE GAL
b5419e5d19 [IMP] use LOCAL_USER_ID calling odoo-bedrock, so no need to create filestore and log folder with 777 2022-06-28 16:55:08 +02:00
Sylvain LE GAL
451be8c389 FIX pass execution_context 2022-06-28 01:22:24 +02:00
Sylvain LE GAL
b64c445cb4 [WIP] 2022-06-28 01:06:23 +02:00
Sylvain LE GAL
429b8013b9 le run, ça marche ! (bon bah pour toute les versions...) 2022-06-27 23:53:51 +02:00
Sylvain LE GAL
bac5d0d22e wip 2022-06-27 21:59:57 +02:00
Sylvain LE GAL
bacca4f7c6 wip 2022-06-27 17:21:15 +02:00
Sylvain LE GAL
80e5e3ad87 [REF] Dockerfiles : switch from odoo/odoo to acsone/odoo-bedrock 2022-06-27 15:56:28 +02:00
Sylvain LE GAL
b37bfa8e31 [REF] create tools & cli folders 2022-06-27 01:57:31 +02:00
Sylvain LE GAL
f895b7d05a [REF] move all templates present in python file into a 'templates' subfolder 2022-06-27 00:34:39 +02:00
Sylvain LE GAL
8836c2c656 [IMP] make resilient the call estimate-workload if some modules are unknown 2022-06-26 21:28:12 +02:00
Sylvain LE GAL
599ba9599c [FIX] various fixes 2022-06-23 20:42:34 +02:00
Sylvain LE GAL
57377fe924 [REF] merge version and release concept and simplify version settings 2022-06-22 00:28:41 +02:00
Sylvain LE GAL
2135ebdde8 [IMP] Add option --jobs for 'get-code' command 2022-06-21 13:11:05 +02:00
Sylvain LE GAL
d23804f4b4 [IMP] allow to call run with a specific execution_context 2022-06-21 13:03:31 +02:00
LE GAL SYLVAIN
65faab03b6 Dev 4 finish openupgrade analyse 2022-06-20 21:57:44 +00:00
Sylvain LE GAL
6b50a0ed7f [FIX] temporary disable a buggy function 2022-06-17 09:54:57 +02:00