我想为DOCKERIZED ODOO服务器运行一个脚本文件,以使用所有的基本模块运行我所有的自定义模块

我已经在我的Ubuntu中安装了DOCKER ,并且在Docker中也将ODOO映像作为容器,odoo映像在docker上运行成功,但是我无法运行我的testing脚本。

我有我自己的脚本文件指的是运行我的自定义模块和其他文件,其中有以下内容:

tests.sh

ADDONS_DIR="./addons" DELETE_DB="dropdb testdb" MODULE_LIST="hr_contract_leaves,hr_employee_birthdat_reminder,hr_employee_documents,hr_employee_emergency_contract,hr_employee_loan,hr_employee_medical_information,hr_employee_statutory_detail,hr_payslip_reports,hr_recruitment_interviewer,hr_recruitment_job_stage_survey,hr_recruitment_reports,account,account_accountant,board,calendar,contacts,crm,fleet,hr,hr_attendance,hr_expense,hr_holidays,hr_payroll,hr_recruitment,hr_timesheet,im_livechat,lunch,mail,maintenance,mass_mailing,mrp,mrp_repair,note,point_of_sale,project,project_issue,purchase,sale,survey,website,website_blog,website_event,website_forum,website_slides" echo "Testing for modules: $MODULE_LIST" RUN_ODOO="/gitlab-runner/gitlab-runner-server/odoo-bin --addons-path=/gitlab-runner/gitlab-runner-server/addons --log-level error -d testdb --init $MODULE_LIST --test-enable --stop-after-init 2>&1 | tee test_results.log" echo "Starting tests with the following command: $RUN_ODOO" eval $RUN_ODOO echo "Tests Finished" RESULT=$(grep "FAIL\|ERROR" test_results.log) echo "Failure in tests: $RESULT" echo "Cleaning up" echo "Deleting Databse" eval $DELETE_DB echo "Database Deleted" echo "Removing log file" rm test_results.log echo "Log file deleted" echo "Clean up finished" if [ ! -z "$RESULT" ] then echo "Failed" exit 1 else echo "PASSED" exit 0 fi 

请,任何人都可以帮助我在docker odoo上运行我的脚本文件,因为我是新的,所以我希望一步一步的指导

先谢谢你…

如果你想覆盖图像的默认entrypoint.sh ,你可以指定--entrypoint docker run --entrypoint选项,如下所示:

 docker run -d --entrypoint=test.sh odoo:10.0 

这将导致容器在启动时运行test.sh ,而不是默认的entrypoint.sh 。 这是不build议的,正如你可以从entrypoint.sh看到的,它支持其他数据库相关的configuration。

如果你所有的test.sh脚本都是添加你自己的模块并提供一些额外的选项,你可以:

  1. 覆盖默认的odoo.conf文件以提供您自己的addons_path
  2. 安装您的自定义插件文件夹
  3. 将选项指定为docker run命令参数

有了这个:

 docker run -p 8069:8069 \ -v /path/to/your_config_file:/etc/odoo \ -v /path/to/your_addons_folder:/mnt/extra-addons \ --name odoo \ --link testdb:testdb \ -t odoo:10.0 --log-level error -d testdb --init $MODULE_LIST --test-enable --stop-after-init 

您不必担心指定自己的日志文件(如test_results.log ,因为您可以使用test_results.log日志查看容器docker logs

    Interesting Posts