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.

91 lines
2.9 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. check-secret:
  25. runs-on: ubuntu-latest
  26. steps:
  27. - name: Check that DINAR_TOKEN is set
  28. run: |
  29. test -z "${{ secrets.DINAR_TOKEN }}" && echo "DINAR_TOKEN is not set" && exit 1
  30. rebuild-images:
  31. runs-on: ubuntu-latest
  32. needs:
  33. - check-secret
  34. steps:
  35. - name: Checkout Repo
  36. uses: actions/checkout@v2
  37. with:
  38. path: REPO
  39. - name: Checkout DINAR
  40. uses: actions/checkout@v2
  41. with:
  42. path: DINAR
  43. repository: itpp-labs/DINAR-fork
  44. ref: master
  45. - uses: actions/setup-python@v1
  46. with:
  47. python-version: "3.7.x"
  48. - name: Prepare build folder
  49. run: |
  50. cp -rnT DINAR/embedded-files/ REPO/
  51. - name: Configure Docker
  52. run: |
  53. bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN }}
  54. - name: dinar-odoo-base
  55. uses: elgohr/Publish-Docker-Github-Action@master
  56. env:
  57. LOCAL_CUSTOM_DIR: ./image
  58. AGGREGATE: true
  59. PIP_INSTALL_ODOO: false
  60. CLEAN: false
  61. COMPILE: false
  62. with:
  63. name: ${{ env.IMAGE_ODOO_BASE }}
  64. registry: ${{ env.REGISTRY }}
  65. username: ${{ env.REGISTRY_USERNAME }}
  66. password: ${{ env.REGISTRY_PASSWORD }}
  67. buildargs: ODOO_VERSION,AGGREGATE,PIP_INSTALL_ODOO,CLEAN,COMPILE,LOCAL_CUSTOM_DIR
  68. workdir: REPO/.DINAR/
  69. - name: Install python tools
  70. run: |
  71. pip install plumbum pyyaml
  72. - name: Compute Modules Dependencies
  73. run: |
  74. # sets environment variables that available in next steps via $ {{ env.VAR_NAME }} notation
  75. cd REPO
  76. python ../DINAR/workflow-files/analyze-modules.py all
  77. - name: Install Base Addons
  78. run: |
  79. export MODULES=$ALL_MODULES_DEPENDENCIES
  80. export DOODBA_WITHOUT_DEMO=all
  81. bash DINAR/workflow-files/images-with-preinstalled-modules.sh $IMAGE_DB-nodemo $IMAGE_ODOO-nodemo
  82. export DOODBA_WITHOUT_DEMO=false
  83. bash DINAR/workflow-files/images-with-preinstalled-modules.sh $IMAGE_DB $IMAGE_ODOO