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. schedule:
  21. - cron: "5 5 * * 0"
  22. jobs:
  23. rebuild-images:
  24. runs-on: ubuntu-latest
  25. steps:
  26. - name: Checkout Repo
  27. uses: actions/checkout@v2
  28. with:
  29. path: REPO
  30. - name: Checkout DINAR
  31. uses: actions/checkout@v2
  32. with:
  33. path: DINAR
  34. repository: itpp-labs/DINAR
  35. ref: master # TODO: use fixed version
  36. - uses: actions/setup-python@v1
  37. with:
  38. python-version: "3.7.x"
  39. - name: Prepare build folder
  40. run: |
  41. cp -rnT DINAR/embedded-files/ REPO/
  42. - name: Configure Docker
  43. run: |
  44. bash DINAR/workflow-files/configure-docker.sh ${{ secrets.DINAR_TOKEN }}
  45. - name: dinar-odoo-base
  46. uses: elgohr/Publish-Docker-Github-Action@master
  47. env:
  48. LOCAL_CUSTOM_DIR: ./image
  49. AGGREGATE: true
  50. PIP_INSTALL_ODOO: false
  51. CLEAN: false
  52. COMPILE: false
  53. with:
  54. name: ${{ env.IMAGE_ODOO_BASE }}
  55. registry: ${{ env.REGISTRY }}
  56. username: ${{ env.REGISTRY_USERNAME }}
  57. password: ${{ env.REGISTRY_PASSWORD }}
  58. buildargs: ODOO_VERSION,AGGREGATE,PIP_INSTALL_ODOO,CLEAN,COMPILE,LOCAL_CUSTOM_DIR
  59. workdir: REPO/.DINAR/
  60. cache: ${{ github.event_name != 'schedule' }}
  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