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.

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