Compare commits

..

121 Commits

Author SHA1 Message Date
XuanHuyen
c92860a140 Merge remote-tracking branch 'origin/dev' into huyen_dev 2025-01-17 18:47:57 +07:00
8d58f305de update workflow
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
2025-01-16 10:15:06 +07:00
e863b57c30 Merge pull request 'dev' (#1) from dev into main
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
Reviewed-on: NextERP/Odoo18#1
2025-01-16 10:07:35 +07:00
55b3439aa0 exec @native @docker @push_image @run_test
All checks were successful
Setup Native Action / native (3.12.7) (pull_request) Has been skipped
Setup Native Action / docker (3.12.7) (pull_request) Has been skipped
2025-01-16 10:06:20 +07:00
410a414440 update 2025-01-16 10:02:58 +07:00
8fe0eab1f7 exec @docker @native @push_image @run_test
All checks were successful
Setup Native Action / native (3.12.7) (push) Successful in 1m39s
Setup Native Action / docker (3.12.7) (push) Successful in 1m12s
2025-01-16 10:01:10 +07:00
994df0b8f6 test workflow dev @docker @native @push_image @run_test 2025-01-16 09:58:18 +07:00
1cb1ac90e9 update dev 2025-01-16 09:57:26 +07:00
e951192bdc update workflow add dev
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
2025-01-16 09:57:02 +07:00
56f61e60e5 @exec @docker @native @push_image @run_test 2025-01-16 09:55:35 +07:00
f87a462bdc update workflow trigger on push branch dev 2025-01-16 09:53:49 +07:00
5cd42217dc update workflow
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
2025-01-16 09:50:53 +07:00
c6e373f98b update Makefile
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
2025-01-16 09:47:19 +07:00
092397ed55 exec @native @docker @push_image @run_test
All checks were successful
Setup Native Action / native (3.12.7) (push) Successful in 1m36s
Setup Native Action / docker (3.12.7) (push) Successful in 2m40s
2025-01-16 09:42:35 +07:00
3df5befb36 exec @native @docker @push_image @run_test
Some checks failed
Setup Native Action / native (3.12.7) (push) Failing after 1m27s
Setup Native Action / docker (3.12.7) (push) Has been cancelled
2025-01-16 09:40:10 +07:00
b38beff3de refactor: remove dbfilter(temp) add restore database native, download backup
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
2025-01-16 09:38:47 +07:00
878ec1f6ff update @docker @no_cleanup @restore_db
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Successful in 53s
2025-01-15 18:35:27 +07:00
a869b828e0 update @docker @no_cleanup @restore_db
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 5m48s
2025-01-15 18:19:11 +07:00
8ebbb82321 update @docker @no_cleanup @restore_db
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 5m46s
2025-01-15 17:58:19 +07:00
5132b209aa update @docker @no_cleanup @restore_db
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 54s
2025-01-15 17:56:08 +07:00
1ec96989a9 update @docker @no_cleanup @restore_db
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 56s
2025-01-15 17:54:09 +07:00
a4c4dba282 exec @docker @no_cleanup @restore_db
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 43s
2025-01-15 17:51:09 +07:00
2c63ba1ff3 update @docker @no_cleanup @restore_db
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 45s
2025-01-15 17:48:27 +07:00
e2955e3224 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 5m44s
2025-01-15 16:36:10 +07:00
0aa0fbd514 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 54s
2025-01-15 16:34:15 +07:00
7e10755cd8 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been cancelled
2025-01-15 16:30:04 +07:00
b7646da09c exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been cancelled
2025-01-15 16:18:06 +07:00
6ee2087599 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 28s
2025-01-15 16:16:12 +07:00
3711cff660 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 2m11s
2025-01-15 16:12:08 +07:00
a1a5821446 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m52s
2025-01-15 16:02:09 +07:00
c8b202fbca exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m47s
2025-01-15 15:51:01 +07:00
f4d9afe2e4 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m53s
2025-01-15 15:41:12 +07:00
f913523ac1 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m48s
2025-01-15 15:37:02 +07:00
745f48ac35 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m53s
2025-01-15 15:33:16 +07:00
abf8fa46f8 exec @docker @restore_db @no_cleanup
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m56s
2025-01-15 15:30:29 +07:00
6adcfc6a27 add restore db script @docker
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Successful in 2m2s
2025-01-15 15:27:29 +07:00
25d50e9fb2 update @docker @no_cleanup @push_image
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Successful in 2m13s
2025-01-15 14:47:49 +07:00
5ac9df17a3 update @docker
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Successful in 1m58s
2025-01-15 14:44:42 +07:00
8cb575b3f9 update @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m50s
2025-01-15 14:42:22 +07:00
13e3b2ad78 update @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m48s
2025-01-15 14:36:21 +07:00
20194ab7a6 update @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 21s
2025-01-15 14:32:21 +07:00
f0d79c3b59 exec @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been cancelled
2025-01-15 14:31:29 +07:00
3367976a30 exec @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been cancelled
Setup Native Action / docker (3.12.7) (push) Has been cancelled
2025-01-15 14:28:10 +07:00
93bd45188c update @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m33s
2025-01-15 13:58:32 +07:00
a0ce36a342 update @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m51s
2025-01-15 13:55:37 +07:00
0ac86c9a78 exec @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m49s
2025-01-15 13:50:48 +07:00
e518a141fb update
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
2025-01-15 12:30:29 +07:00
fe70ae0c21 exec @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m51s
2025-01-15 12:26:10 +07:00
e8f98d19ad exec @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 2m10s
2025-01-15 12:21:10 +07:00
bbcdcc3ba6 add docker-compose package to workflow
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
2025-01-15 12:20:50 +07:00
42eb7a6247 exec @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m41s
2025-01-15 12:17:17 +07:00
c0bbe9feb5 exec @docker
Some checks failed
Setup Native Action / initialize (3.12.7) (push) Successful in 1m33s
Setup Native Action / native (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 4s
2025-01-15 12:14:32 +07:00
97c9b2ce36 exec @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Failing after 1m9s
2025-01-15 12:10:00 +07:00
0aafdd386f exec @docker
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Successful in 1m9s
2025-01-15 12:05:30 +07:00
92a4cf4009 exec @docker @no_cleanup @push_image
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Successful in 1m14s
2025-01-15 12:01:11 +07:00
c669d1ff50 exec @docker
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Successful in 1m6s
2025-01-15 11:58:37 +07:00
8dd811ed75 exec @docker
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
2025-01-15 11:58:00 +07:00
4b0e7ace5e exec @native @docker
Some checks failed
Setup Native Action / native (3.12.7) (push) Successful in 1m42s
Setup Native Action / docker (3.12.7) (push) Failing after 40s
2025-01-15 11:53:35 +07:00
8904adef8a update workflow : merge 2 workflow to single setup env workflow
All checks were successful
Setup Native Action / native (3.12.7) (push) Has been skipped
Setup Native Action / docker (3.12.7) (push) Has been skipped
2025-01-15 11:52:35 +07:00
80f70ca873 update @native
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Successful in 1m37s
2025-01-15 11:43:11 +07:00
870be42aac update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m18s
2025-01-15 11:40:55 +07:00
817326dac8 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m22s
2025-01-15 11:37:04 +07:00
4b6bff7c65 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m33s
2025-01-15 11:28:13 +07:00
ba5c38f465 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m50s
2025-01-15 11:21:48 +07:00
7c22bc7c84 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m31s
2025-01-15 11:13:34 +07:00
20ec598ce0 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m31s
2025-01-15 11:09:59 +07:00
d763511ac5 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m30s
2025-01-15 11:06:30 +07:00
8f4fde6105 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m30s
2025-01-15 10:56:59 +07:00
7b42b514d0 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m36s
2025-01-15 10:51:08 +07:00
42a686d8c3 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m23s
2025-01-15 10:48:30 +07:00
292351d067 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m25s
2025-01-15 10:43:19 +07:00
10667672e9 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m27s
2025-01-15 10:36:16 +07:00
df1565f305 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m22s
2025-01-15 10:34:22 +07:00
68db2e027e update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 30s
2025-01-15 10:33:15 +07:00
16d5dc8ecb update @native
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
2025-01-15 10:31:56 +07:00
544997a004 update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
2025-01-15 10:25:27 +07:00
530900a6be update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m34s
2025-01-15 09:46:21 +07:00
b70b871d5f update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m46s
2025-01-15 09:40:57 +07:00
5a96182522 add install postgres @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 52s
2025-01-15 09:35:02 +07:00
e42507e073 update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m29s
2025-01-15 09:28:48 +07:00
c0e2c3437a update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 26s
2025-01-15 09:27:15 +07:00
745b831315 update workflow: change from host to docker container @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 2m0s
2025-01-15 09:20:49 +07:00
fab8e6896f update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 37s
2025-01-15 09:18:30 +07:00
e4051c005a update @native
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Has been cancelled
2025-01-15 09:17:49 +07:00
f88a564dfa update @native
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
2025-01-15 09:16:47 +07:00
ae6ecf4fa1 update @native
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
2025-01-15 09:15:50 +07:00
86fa5fb22b @native update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
2025-01-15 09:12:23 +07:00
e4ecf0529b update @native
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (push) Successful in 46s
2025-01-15 09:08:46 +07:00
5f2e4d0a4a update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / test (push) Successful in 19s
Setup Native Action / setup_native (push) Has been skipped
2025-01-15 09:05:58 +07:00
d6a89f5dd8 update
Some checks failed
Setup Native Action / setup_native (push) Waiting to run
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / test (push) Has been cancelled
2025-01-15 09:00:41 +07:00
0e4b51614c update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / test (push) Failing after 18s
Setup Native Action / setup_native (push) Has been skipped
2025-01-15 08:58:31 +07:00
be0162fd7b update (@native)
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (push) Failing after 19s
2025-01-15 08:55:01 +07:00
48e86fd364 refactor: change from pyenv to venv for more simplified package management
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (push) Has been skipped
2025-01-15 08:54:15 +07:00
0151767149 add venv to project
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / test (push) Successful in 0s
Setup Native Action / setup_native (3.12.7) (push) Has been skipped
2025-01-15 08:43:08 +07:00
7ed7b2f6ed update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / test (push) Successful in 0s
Setup Native Action / setup_native (3.12.7) (push) Has been skipped
2025-01-15 08:27:12 +07:00
0a9184fd14 update(@docker)
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Successful in 50s
Setup Native Action / setup_native (3.12.7) (push) Successful in 43s
2025-01-14 18:48:28 +07:00
eb842bb478 update (@docker)
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Successful in 53s
Setup Native Action / setup_native (3.12.7) (push) Has been cancelled
2025-01-14 18:46:43 +07:00
fa2cef9515 update @docker
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Failing after 24s
Setup Native Action / setup_native (3.12.7) (push) Successful in 56s
2025-01-14 18:43:35 +07:00
bcc66013b4 update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Successful in 58s
2025-01-14 18:41:44 +07:00
c0dfa11073 update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Successful in 58s
2025-01-14 18:38:18 +07:00
899e6f16f8 update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Successful in 57s
2025-01-14 18:30:30 +07:00
cba154a3a3 update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 1m16s
2025-01-14 18:28:29 +07:00
7f979a96c0 update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 57s
2025-01-14 18:23:51 +07:00
c1dcba3f3b update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 22s
2025-01-14 18:22:52 +07:00
3eb271dee3 update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 22s
2025-01-14 18:19:25 +07:00
726b205932 update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 23s
2025-01-14 18:18:14 +07:00
58d617c430 update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 21s
2025-01-14 18:14:06 +07:00
1d4a711a35 add noninteractive
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been skipped
Setup Native Action / setup_native (3.12.7) (push) Failing after 23s
2025-01-14 18:11:23 +07:00
3a1e0f2b00 update : refactor file and add native workflow integration
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been cancelled
2025-01-14 18:08:41 +07:00
be1ffd9aac update makefile and workflow
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Successful in 51s
2025-01-14 15:47:12 +07:00
92a8c39b3d update workflow
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Successful in 1m22s
2025-01-14 15:16:58 +07:00
33e3462f54 update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been cancelled
2025-01-14 15:11:47 +07:00
9cd59a1e20 update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Failing after 17s
2025-01-14 15:10:59 +07:00
202e59096b update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Failing after 2s
2025-01-14 14:57:18 +07:00
04d78cb7d1 update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Failing after 19s
2025-01-14 14:54:41 +07:00
6536ed27ba fix file permisson when map from docker
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Failing after 14m18s
2025-01-14 14:31:55 +07:00
40d58fe441 update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Successful in 5m37s
2025-01-14 14:24:32 +07:00
27191a1e38 update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Successful in 5m25s
2025-01-14 14:16:26 +07:00
a8d8eada2a update
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Has been cancelled
2025-01-14 14:06:19 +07:00
a0a3c15937 update
All checks were successful
Setup Docker Action / setup_docker (3.12.7) (push) Successful in 26s
2025-01-14 14:04:46 +07:00
f74d79bb00 update flow
Some checks failed
Setup Docker Action / setup_docker (3.12.7) (push) Failing after 1m3s
2025-01-14 14:02:26 +07:00
17 changed files with 426 additions and 134 deletions

View File

@ -0,0 +1,116 @@
name: Setup Native Action
on:
push:
branches: [main,dev]
pull_request:
branches: [main,dev]
# options in commit : @native @docker @push_image @run_test @no_cleanup @restore_db
jobs:
native:
if: contains(github.event.head_commit.message, '@native')
runs-on: ubuntu-latest
env:
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_SERVER: ${{ vars.DB_SERVER }}
DB_PORT: ${{ vars.DB_PORT }}
strategy:
matrix:
python-version: [3.12.7]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Create Python virtual environment
run: python -m venv venv
- name: Activate virtual environment and install dependencies
run: make install
- name: Generate Config
run: make gen_config
- name: Run Tests
run: make run_test
docker:
if: contains(github.event.head_commit.message, '@docker')
runs-on: host
env:
DB_USER: ${{ secrets.DB_USER }}
DB_PASSWORD: ${{ secrets.DB_PASSWORD }}
DB_SERVER: ${{ vars.DB_SERVER }}
DB_PORT: ${{ vars.DB_PORT }}
strategy:
matrix:
python-version: [3.12.7]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ matrix.python-version }}
- name: Create Python virtual environment
run: python -m venv venv
- name: Activate virtual environment and install dependencies
run: ./venv/bin/pip install python-dotenv
- name: Update Tag
run: make update_tag CURR_BRANCH=${{ github.ref_name }}
- name: Install Docker compose
uses: KengoTODA/actions-setup-docker-compose@v1
with:
version: '2.14.2'
- name: Stop Server Docker
run: make stop_server_docker
- name: Generate Config
run: make gen_config_docker
- name: Build Image
run: make build_image
- name: Start Server
run: make run_server_docker
- name: Sleep for 10 seconds
run: sleep 10
- name: Restore Database
if: contains(github.event.head_commit.message, '@restore_db')
run: make restore_database_docker
- name: Run Tests
if: contains(github.event.head_commit.message, '@run_test')
run: make run_test_docker
- name: Login Docker hub
if: contains(github.event.head_commit.message, '@push_image')
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin ${{ secrets.DOCKER_HUB }}
- name: Push Image
if: contains(github.event.head_commit.message, '@push_image')
run: make push_image
- name: Logout Docker hub
if: contains(github.event.head_commit.message, '@push_image')
run: docker logout ${{ secrets.DOCKER_HUB }}
- name: Clean Up
if: "!contains(github.event.head_commit.message, '@no_cleanup')"
run: make clean_up

View File

@ -1,60 +0,0 @@
name: Setup Docker Action
on:
push:
branches:
- main
# - develop
# pull_request:
# branches:
# - main
jobs:
setup_docker:
runs-on: host
strategy:
matrix:
python:
- 3.12.7
steps:
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}
- name: Clean up Virtual Environment
run: ./setup/clean_up_virtualenvs.sh 0
- name: Create Virtual Environment
run: pyenv virtualenv "${{ github.ref_name }}-$(git rev-parse --short "$GITHUB_SHA")"
- name: Install dotenv
run: pip install python-dotenv
- name: Update Tag
run: make update_tag CURR_BRANCH=${{ github.ref_name }}
- name: Stop Server Docker
run: make stop_server_docker
- name: Generate Config
run: make gen_config
- name: Build Image
run: make build_image
- name: Start Server
run: make run_server_docker
- name: Sleep for 30 seconds
run: sleep 30s
- name: Restore Database
run: make restore_database
- name: Run Tests
run: make run_test_docker
- name: Login Docker hub
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USER }} --password-stdin ${{ secrets.DOCKER_HUB }}
- name: Push Image
run: make push_image
- name: Clean Up
run: make clean_up

View File

@ -1,19 +1,19 @@
name: Setup Docker Action
on:
push:
branches:
branches:
- main
# - develop
# pull_request:
# branches:
# - main
- dev
- feature/*
jobs:
setup_docker:
if: contains(github.event.head_commit.message, '@docker')
runs-on: self-hosted
strategy:
matrix:
python:
- 3.12.7
steps:
- name: Fix Permission
run: |
@ -40,7 +40,7 @@ jobs:
run: make stop_server_docker
- name: Generate Config
run: make gen_config
run: make gen_config_docker
- name: Build Image
run: make build_image
@ -51,7 +51,7 @@ jobs:
run: sleep 30s
- name: Restore Database
run: make restore_database
run: make restore_database_docker
- name: Run Tests
run: make run_test_docker

3
.gitignore vendored
View File

@ -50,4 +50,5 @@ package.json
/share/
/src/
/deployment/postgresql/*
/venv/
/venv/
/deployment/backup/*.zip

View File

@ -2,15 +2,18 @@ FROM odoo:18.0
# Overwrite odoo with addons
COPY ./odoo /usr/lib/python3/dist-packages/
COPY ./addons /usr/lib/python3/dist-packages/odoo
COPY ./deployment/entrypoint.sh /
# Copy entrypoint script and Odoo configuration file
# COPY deployment/entrypoint.sh /
# COPY deployment/odoo.conf /etc/odoo/
# Set permissions and Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons
# Set permissions and Mount /var/lib/odoo to allow restoring filestore and /mnt/extra-addons for users addons and /mnt/backup for backup
RUN chown odoo /etc/odoo/odoo.conf \
&& mkdir -p /mnt/extra-addons \
&& chown -R odoo /mnt/extra-addons
VOLUME ["/var/lib/odoo", "/mnt/extra-addons"]
&& chown -R odoo /mnt/extra-addons \
&& mkdir -p /var/lib/odoo/backup \
&& chown -R odoo /var/lib/odoo/backup
VOLUME ["/var/lib/odoo", "/mnt/extra-addons","/var/lib/odoo/backup"]
# Expose Odoo services
EXPOSE 8069 8071 8072

4
Jenkinsfile vendored
View File

@ -11,12 +11,12 @@ node('Node-Dev-100163') {
stage('Build') {
// sh 'make install'
sh 'make stop_server_docker'
sh 'make gen_config'
sh 'make gen_config_docker'
sh 'make build_image'
}
stage('Start'){
sh 'make run_server_docker'
sh 'make restore_database'
sh 'make restore_database_docker'
}
stage('Testing') {
sh 'make run_test_docker'

View File

@ -2,34 +2,67 @@
PWD = $(shell pwd)
UID = $(shell id -u)
GID = $(shell id -g)
PYTHON=python
PIP=${PWD}/venv/bin/pip
PYTHON=${PWD}/venv/bin/python
DOCKERCMD=docker
DOCKER_COMPOSE_CMD=docker-compose
DOCKER_BUILD=$(DOCKERCMD) build
DOCKER_PUSH=$(DOCKERCMD) push
DOCKER_IMAGE=$(DOCKERCMD) image
DOCKER_EXEC=$(DOCKERCMD) exec
DEPLOY_PATH=${PWD}/deployment
SETUP_PATH=${PWD}/setup
CONFIG=odoo.conf
ODOO_IMAGE=hub.nextzenos.com/nexterp/odoo
TAG := $(shell rev-parse --abbrev-ref HEAD)
CONTAINER_ID=odoo-${TAG}
HUB=hub.nextzenos.com
CDN=https://cdn.nextzenos.com/CDN/NextERP
ORGANIZATION=nexterp
PROJECT := odoo18
ODOO_IMAGE=${HUB}/${ORGANIZATION}/$(PROJECT)
TAG := $(shell git rev-parse --abbrev-ref HEAD)
CONTAINER_ID=${PROJECT}-${TAG}
VERSION := community
ADDONS=${PWD}/addons,${PWD}/odoo/addons
BACKUP=${CDN}/raw/branch/main/backup/${VERSION}/odoo18-main_2025-01-15_08-05-47.zip
##### Native Deployment#########
install:
sudo apt -y update && \
sudo apt install -y build-essential python3-full python3-pip libldap2-dev libpq-dev libsasl2-dev
run_test_docker:
sudo docker exec ${CONTAINER_ID} odoo --test-tags :TestAccountMove.test_out_invoice_auto_post_monthly,TestAccountMove.test_included_tax --log-level=test --test-enable -d testdb --stop-after-init --config=/etc/odoo/${CONFIG} --xmlrpc-port=8071 && \
sudo docker exec ${CONTAINER_ID} odoo db --config=/etc/odoo/${CONFIG} drop testdb
run_test_local:
odoo-bin -i all_modules --log-level=test --test-enable -d testdb --stop-after-init --config=${CONFIG}
sudo apt update -y && \
sudo apt install -y python3-pip libldap2-dev libpq-dev libsasl2-dev postgresql-client && \
${PIP} install --no-input -r requirements.txt --break-system-packages
download_backup:
@if [ -z "${LINKDB}" ]; then \
LinkDB=${BACKUP}; \
read -p "LinkDownload [default: ${BACKUP}]: " InputLinkDB; \
LinkDB=$${InputLinkDB:-${BACKUP}}; \
else \
LinkDB=${LINKDB}; \
fi; \
Filename=$$(basename $$LinkDB); \
echo "Downloading $$Filename from: $$LinkDB"; \
${PWD}/setup/download_backup.sh $$LinkDB backup.zip
gen_config:
${PWD}/setup/init_config.sh ${ODOO_IMAGE} ${TAG} ${CONTAINER_ID}
$(MAKE) download_backup LINKDB=${BACKUP}
${PWD}/setup/init_config.sh --native ${ADDONS}
run_server:
${PYTHON} odoo-bin --config=${CONFIG}
run_test:
${PYTHON} odoo-bin --test-tags :TestAccountMove.test_out_invoice_auto_post_monthly,TestAccountMove.test_included_tax --log-level=test --test-enable -d testdb-${TAG} --stop-after-init --config=${CONFIG}
${PYTHON} odoo-bin db --config=${CONFIG} drop testdb-${TAG}
restore_database:
@read -p "Enter the database name: " DBNAME; \
echo "Restoring database: $$DBNAME"; \
${PYTHON} odoo-bin db --config=${CONFIG} load $$DBNAME ${PWD}/deployment/backup/backup.zip
##### Docker Deployment #########
run_test_docker:
sudo ${DOCKER_EXEC} ${CONTAINER_ID} odoo --test-tags :TestAccountMove.test_out_invoice_auto_post_monthly,TestAccountMove.test_included_tax --log-level=test --test-enable -d testdb-${TAG} --stop-after-init --config=/etc/odoo/${CONFIG} --xmlrpc-port=8071 && \
sudo ${DOCKER_EXEC} ${CONTAINER_ID} odoo db --config=/etc/odoo/${CONFIG} drop testdb-${TAG}
gen_config_docker:
$(MAKE) download_backup LINKDB=${BACKUP}
${PWD}/setup/init_config.sh --docker ${ODOO_IMAGE} ${TAG} ${CONTAINER_ID}
build_image:
DOCKER_BUILDKIT=1 ${DOCKER_BUILD} . --progress plain --tag ${ODOO_IMAGE}:${TAG}
push_image:
$(DOCKER_PUSH) ${ODOO_IMAGE}:${TAG}
run_server_local:
${PYTHON} odoo-bin --config=${CONFIG}
run_server_docker:
@if ! docker ps | grep -q "${CONTAINER_ID}"; then \
echo "Container not found. Running docker-compose up -d"; \
@ -40,15 +73,8 @@ run_server_docker:
${DOCKER_COMPOSE_CMD} up -d
update_tag:
${SETUP_PATH}/update_tag.sh $(CURR_BRANCH)
restore_database:
@echo "Checking for backup.zip in container..."
@if sudo docker exec ${CONTAINER_ID} test -f /etc/odoo/backup/backup.zip; then \
echo "Restoring database from backup..."; \
sudo docker exec ${CONTAINER_ID} odoo db --config=/etc/odoo/${CONFIG} load backup /etc/odoo/backup/backup.zip; \
else \
echo "Error: backup.zip not found in container. Aborting restore."; \
fi
restore_database_docker:
sudo ${DOCKER_EXEC} ${CONTAINER_ID} odoo db -c /etc/odoo/odoo.conf load backup /var/lib/odoo/backup/backup.zip
stop_server_docker:
@if ! docker ps | grep -q "${CONTAINER_ID}"; then \
echo "Container not found. Skipping"; \

Binary file not shown.

View File

@ -3,7 +3,7 @@ services:
app:
image: ${ODOO_IMAGE:-odoo}:${ODOO_TAG:-18}
container_name: ${ODOO_CONTAINER:-odoo}
user: root
# user: root
depends_on:
- db
ports:
@ -16,14 +16,13 @@ services:
- USER=${PG_USER:-changeme}
- PASSWORD=${PG_PASS:-password}
volumes:
- ${ENTRYPOINT:-./entrypoint.sh}:/entrypoint.sh # use for install additional package (Optional)
- ${ODOO_ADDONS:-./addons}:/mnt/extra-addons
- ${ODOO_CONFIG:-./etc}:/etc/odoo
- ${ODOO_BACKUP:-./backup/ce}:/etc/odoo/backup
- ${ODOO_BACKUP:-./backup}:/var/lib/odoo/backup
restart: always
db:
image: postgres:16
user: root
# user: root
environment:
- POSTGRES_USER=${PG_USER:-changeme}
- POSTGRES_PASSWORD=${PG_PASS:-password}

View File

@ -7,10 +7,9 @@ ODOO_CONTAINER=
# ODOO_CHAT_PORT=
ODOO_ADDONS=./addons
ODOO_CONFIG=./etc
ODOO_BACKUP=./backup/ce
ODOO_BACKUP=./backup
#Database
PG_PORT=
PG_DB=
PG_USER=
PG_PASS=
ENTRYPOINT=./entrypoint.sh

9
deployment/etc/odoo.conf Normal file
View File

@ -0,0 +1,9 @@
[options]
addons_path = /mnt/extra-addons
data_dir = /var/lib/odoo
db_host = db
db_port = 5432
db_user = default_repo
db_password = smartyourlife
proxy_mode = True

View File

@ -3,4 +3,7 @@ db_host =
db_port = 5432
db_user =
db_password =
xmlrpc_port =
addons_path =
dbfilter =
proxy_mode =

View File

@ -20,7 +20,7 @@ if (( keep_count > 0 )); then
# Loop through the oldest virtual environments and delete them
for venv in $oldest_venvs; do
echo "Deleting virtual environment: $venv"
pyenv virtualenv-delete "$venv" -f
pyenv virtualenv-delete -f "$venv"
done
fi

82
setup/download_backup.sh Executable file
View File

@ -0,0 +1,82 @@
#!/usr/bin/bash
export PATH=/usr/sbin:$PATH
export DEBIAN_FRONTEND=noninteractive
set -euo pipefail
readonly COLOUR_RESET='\e[0m'
readonly aCOLOUR=(
'\e[38;5;154m' # green | Lines, bullets and separators
'\e[1m' # Bold white | Main descriptions
'\e[90m' # Grey | Credits
'\e[91m' # Red | Update notifications Alert
'\e[33m' # Yellow | Emphasis
)
trap 'onCtrlC' INT
onCtrlC() {
echo -e "${COLOUR_RESET}"
exit 1
}
Show() {
# OK
if (($1 == 0)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} OK $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# FAILED
elif (($1 == 1)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[3]}FAILED$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
exit 1
# INFO
elif (($1 == 2)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[0]} INFO $COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
# NOTICE
elif (($1 == 3)); then
echo -e "${aCOLOUR[2]}[$COLOUR_RESET${aCOLOUR[4]}NOTICE$COLOUR_RESET${aCOLOUR[2]}]$COLOUR_RESET $2"
fi
}
Warn() {
echo -e "${aCOLOUR[3]}$1$COLOUR_RESET"
}
GreyStart() {
echo -e "${aCOLOUR[2]}\c"
}
ColorReset() {
echo -e "$COLOUR_RESET\c"
}
main() {
DEPLOYMENT_DIR=$(pwd)/deployment
BACKUP_DIR="$DEPLOYMENT_DIR/backup"
DOWNLOAD_URL="$1"
BACKUP_FILE="$BACKUP_DIR/$2"
# Check if the deployment and backup directories exist, create them if not
if [[ ! -d "$BACKUP_DIR" ]]; then
echo "Backup directory does not exist. Creating: $BACKUP_DIR"
mkdir -p "$BACKUP_DIR"
fi
# Check if the download URL is valid
echo "Checking if the URL is valid: $DOWNLOAD_URL"
if curl --head --silent --fail "$DOWNLOAD_URL" > /dev/null; then
echo "URL is valid. Proceeding with download..."
else
Show 1 "Error: Invalid or inaccessible URL: $DOWNLOAD_URL"
exit 1
fi
# Download the file and rename it to backup.zip
wget -O "$BACKUP_FILE" "$DOWNLOAD_URL"
# Check if the file was downloaded
if [[ -f "$BACKUP_FILE" ]]; then
Show 0 "Backup file successfully downloaded to: $BACKUP_FILE"
else
Show 1 "Error: Backup file was not downloaded."
exit 1
fi
}
main "$@"

67
setup/gen_config.py Normal file
View File

@ -0,0 +1,67 @@
#!/usr/bin/env python3
import argparse
import configparser
import shutil
import os
from dotenv import set_key
from pathlib import Path
import socket
import secrets
import string
import color_log
def find_available_port(start_port=80):
"""Finds an available port starting from the given port."""
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
while True:
try:
sock.bind(('0.0.0.0', start_port))
color_log.Show(3,f" {start_port} is Open")
return start_port
except OSError as e:
if e.errno == 98: # Address already in use
print(f"{start_port} already in use , Try other port ...")
start_port += 1
else:
raise
def main():
"""
Generates a random password and finds an available port.
Updates the Odoo configuration file and .env file with these values.
"""
parser = argparse.ArgumentParser(description="Generate Odoo configuration")
parser.add_argument('--db_user', type=str, help='')
parser.add_argument('--db_pass', type=str, help='')
parser.add_argument('--deploy_path', type=str, help='')
parser.add_argument('--addons_path', type=str, help='')
# parser.add_argument('--db_filter', type=str, help='')
parser.add_argument('--db_port', type=int, help='')
parser.add_argument('--db_server', type=str, help='')
args = parser.parse_args()
db_port = args.db_port
db_user = args.db_user
db_pass = args.db_pass
db_server = args.db_server
app_port = find_available_port(8069)
addons_path = args.addons_path
base_dir= args.deploy_path
# db_filter= args.db_filter
# Copy template files
os.makedirs(f"{base_dir}/etc", exist_ok=True)
color_log.Show(3,f"Copy {base_dir}/odoo.conf.template to {base_dir}/etc/odoo.conf")
shutil.copyfile(f'{base_dir}/odoo.conf.template', f'{base_dir}/odoo.conf')
# Update Odoo configuration file
config = configparser.ConfigParser()
config.read(f'{base_dir}/odoo.conf')
config['options']['db_host'] = str(db_server)
config['options']['db_user'] = db_user
config['options']['db_password'] = db_pass
config['options']['db_port'] = str(db_port)
config['options']['addons_path'] = addons_path
config['options']['xmlrpc_port'] = str(app_port)
config['options']['dbfilter'] = ".*"
config['options']['proxy_mode'] = "True"
with open(f'{base_dir}/odoo.conf', 'w') as configfile:
config.write(configfile)
if __name__ == "__main__":
main()

View File

@ -19,7 +19,7 @@ def find_available_port(start_port=80):
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock:
while True:
try:
sock.bind(('localhost', start_port))
sock.bind(('0.0.0.0', start_port))
color_log.Show(3,f" {start_port} is Open")
return start_port
except OSError as e:
@ -78,7 +78,7 @@ def main():
# Update .env file
env_file_path = Path("deployment/.env")
set_key(dotenv_path=env_file_path, key_to_set="COMPOSE_PROJECT_NAME", value_to_set=f"odoo-{tag}",quote_mode="never")
set_key(dotenv_path=env_file_path, key_to_set="PG_PORT", value_to_set=find_available_port(5432),quote_mode="never")
set_key(dotenv_path=env_file_path, key_to_set="PG_PORT", value_to_set=find_available_port(int(os.getenv('DB_PORT','5432'))+1),quote_mode="never")
set_key(dotenv_path=env_file_path, key_to_set="PG_USER", value_to_set=db_user,quote_mode="never")
set_key(dotenv_path=env_file_path, key_to_set="PG_PASS", value_to_set=db_pass,quote_mode="never")
set_key(dotenv_path=env_file_path, key_to_set="ODOO_CONFIG", value_to_set=config_path,quote_mode="never")
@ -87,9 +87,7 @@ def main():
set_key(dotenv_path=env_file_path, key_to_set="ODOO_IMAGE", value_to_set=image,quote_mode="never")
set_key(dotenv_path=env_file_path, key_to_set="ODOO_TAG", value_to_set=tag,quote_mode="never")
set_key(dotenv_path=env_file_path, key_to_set="ODOO_CONTAINER", value_to_set=container,quote_mode="never")
if (backup == 'community'):
set_key(dotenv_path=env_file_path, key_to_set="ODOO_BACKUP", value_to_set=f'{base_dir}/backup/ce',quote_mode="never")
if (backup == 'enterprise'):
set_key(dotenv_path=env_file_path, key_to_set="ODOO_BACKUP", value_to_set=f'{base_dir}/backup/enterprise',quote_mode="never")
set_key(dotenv_path=env_file_path, key_to_set="ODOO_BACKUP", value_to_set=backup,quote_mode="never")
if __name__ == "__main__":
main()

View File

@ -5,15 +5,15 @@ export DEBIAN_FRONTEND=noninteractive
set -euo pipefail
DEPLOY_PATH=$(pwd)/deployment
SETUP_PATH=$(pwd)/setup
ODOO_IMAGE=$1
ODOO_TAG=$2
ODOO_CONTAINER=$3
PG_USER=nexterp
ODOO_ADDONS=./addons
ODOO_CONFIG=./etc
PIP=$(pwd)/venv/bin/pip
PYTHON=$(pwd)/venv/bin/python
ODOO_ADDONS=${DEPLOY_PATH}/addons
ODOO_CONFIG=${DEPLOY_PATH}/etc
ODOO_BACKUP=${DEPLOY_PATH}/backup
# System
DEPENDS_PACKAGE=('wget' 'curl' 'git' 'unzip' 'make' 'wkhtmltopdf')
DEPENDS_COMMAND=('wget' 'curl' 'git' 'unzip' 'make' 'wkhtmltopdf')
DEPENDS_PACKAGE=('wget' 'curl' 'git' 'unzip' 'make' 'wkhtmltopdf' 'postgresql-client')
DEPENDS_COMMAND=('wget' 'curl' 'git' 'unzip' 'make' 'wkhtmltopdf' 'psql')
((EUID)) && sudo_cmd="sudo" || sudo_cmd=""
readonly MINIMUM_DOCER_VERSION="20"
UNAME_U="$(uname -s)"
@ -86,16 +86,6 @@ Check_OS() {
exit 1
fi
}
Generate_Config(){
if [[ ! -f "${DEPLOY_PATH}/.env" ]]; then
cp "${DEPLOY_PATH}/env.template" "${DEPLOY_PATH}/.env"
fi
python "$SETUP_PATH/gen-config.py" --db_port 5432 --db_user $PG_USER --deploy_path "$DEPLOY_PATH" \
--image "${ODOO_IMAGE}" --container "${ODOO_CONTAINER}" --tag "${ODOO_TAG:=latest}" \
--addons "${ODOO_ADDONS}" --config "${ODOO_CONFIG}" --backup community
Show 0 " Generate Config Complete"
}
Install_Depends() {
for ((i = 0; i < ${#DEPENDS_COMMAND[@]}; i++)); do
cmd=${DEPENDS_COMMAND[i]}
@ -188,9 +178,68 @@ Check_Docker_Install_Final() {
exit 1
fi
}
Check_OS
# Update_Package_Resource
# Install_Depends
# Check_Dependency_Installation
# Check_Docker_Install
Generate_Config
Generate_Config_Docker(){
ODOO_IMAGE=${1:-}
ODOO_TAG=${2:-}
ODOO_CONTAINER=${3:-}
if [[ ! -f "${DEPLOY_PATH}/.env" ]]; then
cp "${DEPLOY_PATH}/env.template" "${DEPLOY_PATH}/.env"
fi
USER="${REPO_NAME:-"default_repo"}"
# Convert to lowercase
USER="${USER,,}"
${PYTHON} "$SETUP_PATH/gen_config_docker.py" --db_port 5432 --db_user $USER --deploy_path "$DEPLOY_PATH" \
--image "${ODOO_IMAGE}" --container "${ODOO_CONTAINER}" --tag "${ODOO_TAG:=latest}" \
--addons "${ODOO_ADDONS}" --config "${ODOO_CONFIG}" --backup "${ODOO_BACKUP}"
Show 0 " Generate Config Complete"
}
Generate_Config_Native(){
# Load environment variables from .env file
Show 2 "Environment variables loaded:"
printenv | sort
ADDONS=${1:-}
REPO_NAME=$(basename "$(git rev-parse --show-toplevel)" | sed -E 's/[.-]/_/g')
USER="${REPO_NAME:-"default_repo"}"
# Convert to lowercase
USER="${USER,,}"
PASSWORD="$(openssl rand -hex 24)"
# Check if the user already exists
USER_EXISTS=$(psql "postgresql://${DB_USER}:${DB_PASSWORD}@${DB_SERVER}:${DB_PORT}/postgres" -t -A -c "SELECT COUNT(*) FROM pg_roles WHERE rolname='$USER';")
if [ $USER_EXISTS -eq 0 ]; then
# User does not exist, create the user
Show 2 "Create the new PostgreSQL username: $USER with password: $PASSWORD"
psql "postgresql://${DB_USER}:${DB_PASSWORD}@${DB_SERVER}:${DB_PORT}/postgres" -c "CREATE USER $USER WITH PASSWORD '$PASSWORD';"
Show 2 "Grant $USER superuser (admin) privileges"
psql "postgresql://${DB_USER}:${DB_PASSWORD}@${DB_SERVER}:${DB_PORT}/postgres" -c "ALTER USER $USER WITH SUPERUSER;"
else
# User exists, update the password (do not try to create)
Show 2 "User $USER already exists, updating password to $PASSWORD"
psql "postgresql://${DB_USER}:${DB_PASSWORD}@${DB_SERVER}:${DB_PORT}/postgres" -c "ALTER USER $USER WITH PASSWORD '$PASSWORD';"
fi
${PYTHON} "$SETUP_PATH/gen_config.py" --db_user $USER --db_pass $PASSWORD --deploy_path "$(pwd)" \
--addons_path $ADDONS --db_port $DB_PORT --db_server $DB_SERVER
Show 0 " Generate Config Complete"
}
main(){
TYPE=${1:-}
Check_OS
# Update_Package_Resource
# Install_Depends
# Check_Dependency_Installation
# Check_Docker_Install
case "$TYPE" in
--native)
Generate_Config_Native $2
;;
--docker)
Generate_Config_Docker $2 $3 $4
;;
*)
# else
Show 1 "Invalid argument (--docker|--native)"
;;
esac
}
main ${1:-} ${2:-} ${3:-} ${4:-}