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.

131 lines
4.1 KiB

  1. [![Doodba deployment](https://img.shields.io/badge/deployment-doodba-informational)](https://github.com/Tecnativa/doodba)
  2. [![Last template update](https://img.shields.io/badge/last%20template%20update-v2.6.1-informational)](https://github.com/Tecnativa/doodba-copier-template/tree/v2.6.1)
  3. [![Odoo](https://img.shields.io/badge/odoo-v14.0-a3478a)](https://github.com/odoo/odoo/tree/14.0)
  4. [![AGPL-3.0-or-later license](https://img.shields.io/badge/license-AGPL--3.0--or--later-success})](LICENSE)
  5. [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://pre-commit.com/)
  6. [Read the docs.](https://github.com/Tecnativa/doodba#scaffolding)
  7. # Myceliandre freezing
  8. There are a number of floating target that needs to be replaced to ensure as much as
  9. possible a rebuildable fixed target image.
  10. ## How do we freeze
  11. The fixing process will be conducted by an external script that will go through all
  12. moving targets to replace them with a fixed version.
  13. The fixing process could have involved running a docker build, and using the resulting
  14. image to fix and freeze things by modifying files in `odoo_base`.
  15. But, because some cleaning processes (removing of `.git` dir) are conducted, we choose
  16. to do part of it before (inspecting git sources, and fixing `repos.yaml` before hand).
  17. Other part of this process still are more simply done on the resulting image built by
  18. `pip` or `apt` because the full version dep graph is more easily queryiable on a
  19. resulting installation that buildable by inference.
  20. ## What is freezed
  21. This modify files everywhere and this will be pushed as a commit automatically with a
  22. tag <version>-<timestamp>. The corresponding image should be easily found in
  23. `docker.0k.io` repository with same tag.
  24. When possible, the version will also be saved locally.
  25. ### original docker base
  26. Check if `FROM` is local (from docker.0k.io), otherwise we need to tag it and push it to
  27. `docker.0k.io`.
  28. tecnativa/doodba:12.0-onbuild
  29. once caught, execute a `docker pull MOVING_REF`, then tag and push on docker.0k.io,
  30. modify file in odoodba
  31. ### full git-aggregators
  32. track any refs that are branches. If repository has a branch, is not cloned in gittea,
  33. then clone it, create tag with current global tag (<version>-<timestamp>), replace
  34. source URL, target in yaml file by tag. Keep in comments the actual original source and
  35. original targets.
  36. Needs to be checked on the checked image, on the repositories.
  37. ### Pip package
  38. A `pip freeze` need to be run to get all versions, and for easy diff, output a file that
  39. would be:
  40. ```
  41. package1==version
  42. ...
  43. ## Unspecified deps
  44. packageA==version
  45. ```
  46. ### apt packages
  47. Same here
  48. ```
  49. ## gives all packages installed and their version
  50. dpkg-query -l | grep ^ii | awk '{print $2 "\t" $3}'
  51. ```
  52. # We need to produce a meaningfull report of differences between versions
  53. The best would be to be able to use `git diff`.
  54. # Additional possibility for committing a new release
  55. we could flatten git history, and docker resulting incremental image (diffing exports of
  56. docker files).
  57. # Process
  58. ## freezing a completely new version
  59. ```
  60. bin/freeze
  61. ```
  62. That will be run on gitea automatically and pushed as a tagged version.
  63. But this is also doable from the dev computer.
  64. ## Making modification
  65. git co master # (unfreezed version)
  66. OR git clone -b BRANCH release/candidate/YYYMMDD-HHMMSS
  67. Make modif, commit. Gitea will automatically create a new:
  68. - release/candidate/YYYMMDD-HHMMSS branch
  69. ## Checking possible updates (optional)
  70. Identify locked entries, and go fetch update, allow to update.
  71. ## Updating
  72. Ask to update one of the links
  73. ## Troubleshooting
  74. ```
  75. docker run -ti \
  76. --env PLUGIN_SSH_KNOWN_HOSTS="$(ssh-keyscan -H -p 10022 git.0k.io 2>/dev/null)" \
  77. --env PLUGIN_SSH_PRIVATE_KEY="$(cat ~/.ssh/ssh_myceliandre_mirror)" \
  78. --env PLUGIN_DOCKER_CONFIG_JSON='{"auths": {"docker.0k.io": {"auth": "bWlycm9yOkh1bnZNSlpJMW9ra3VoSWs="}}}' \
  79. -v /var/run/docker.sock:/var/run/docker.sock \
  80. -v /home/vaab/dev/docker/odoo_base:/tmp/odoo_base \
  81. -w /tmp/odoo_base \
  82. -v /home/vaab/dev/sh/0k-docker/src/bin/dupd:/usr/local/bin/dupd \
  83. docker.0k.io/0k-mirror-freezer /bin/bash
  84. ```