You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.7 KiB

  1. # Copyright 2020 IT Projects Labs
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. name: "DINAR: Docker Image Building"
  15. on:
  16. push:
  17. paths:
  18. - ".DINAR/**"
  19. - ".github/workflows/DINAR.yml"
  20. # Cron works only for defaul branch. See https://github.com/itpp-labs/DINAR/issues/48
  21. schedule:
  22. - cron: "5 5 * * 0"
  23. jobs:
  24. rebuild-images:
  25. runs-on: ubuntu-latest
  26. steps:
  27. - name: Checkout Repo
  28. uses: actions/checkout@v2
  29. with:
  30. path: REPO
  31. - name: Checkout DINAR
  32. uses: actions/checkout@v2
  33. with:
  34. path: DINAR
  35. repository: itpp-labs/DINAR-fork
  36. ref: master
  37. - uses: actions/setup-python@v1
  38. with:
  39. python-version: "3.7.x"
  40. - name: Prepare build folder
  41. run: |
  42. cp -rnT DINAR/embedded-files/ REPO/
  43. - name: Configure Docker
  44. run: |
  45. bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN }}
  46. - name: dinar-odoo-base
  47. uses: elgohr/Publish-Docker-Github-Action@master
  48. env:
  49. LOCAL_CUSTOM_DIR: ./image
  50. AGGREGATE: true
  51. PIP_INSTALL_ODOO: false
  52. CLEAN: false
  53. COMPILE: false
  54. with:
  55. name: ${{ env.IMAGE_ODOO_BASE }}
  56. registry: ${{ env.REGISTRY }}
  57. username: ${{ env.REGISTRY_USERNAME }}
  58. password: ${{ env.REGISTRY_PASSWORD }}
  59. buildargs: ODOO_VERSION,AGGREGATE,PIP_INSTALL_ODOO,CLEAN,COMPILE,LOCAL_CUSTOM_DIR
  60. workdir: REPO/.DINAR/
  61. - name: Install python tools
  62. run: |
  63. pip install plumbum pyyaml
  64. - name: Compute Modules Dependencies
  65. run: |
  66. # sets environment variables that available in next steps via $ {{ env.VAR_NAME }} notation
  67. cd REPO
  68. python ../DINAR/workflow-files/analyze-modules.py all
  69. - name: Install Base Addons
  70. run: |
  71. export MODULES=$ALL_MODULES_DEPENDENCIES
  72. export DOODBA_WITHOUT_DEMO=all
  73. bash DINAR/workflow-files/images-with-preinstalled-modules.sh $IMAGE_DB-nodemo $IMAGE_ODOO-nodemo
  74. export DOODBA_WITHOUT_DEMO=false
  75. bash DINAR/workflow-files/images-with-preinstalled-modules.sh $IMAGE_DB $IMAGE_ODOO