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.

101 lines
3.3 KiB

  1. * Important notice
  2. As the current docker install of gogocarto as of <2020-10-20 Tue> is
  3. far from being mature, we try here to get only the released part.
  4. We are talking of:
  5. [[https://gitlab.adullact.net/pixelhumain/GoGoCarto/-/blob/f3c10f16fc08b533ef44f1325fdb50f87fa73224/docs/installation_docker.md][gogocarto docker install documentation]]
  6. ** Intermediate docker image is cached on docker.0k.io if needed
  7. To rebuild a new version, I pushed the huge docker image of
  8. =gogocarto= container that is required in the process (that contains
  9. apache and all build/install tools). Note that this should not require
  10. to be rebuild if anything important changes in the directory =docker/=.
  11. Using:
  12. #+begin_src sh
  13. docker_tree_hash=$(git rev-parse HEAD:docker)
  14. docker tag docker_gogocarto docker.0k.io/gogocarto-builder:${docker_tree_hash}
  15. docker push docker.0k.io/gogocarto-builder:${docker_tree_hash}
  16. #+end_src
  17. So, if needed, it can be pulled back to avoid the hassle of making it:
  18. #+begin_src sh
  19. docker_tree_hash=$(git rev-parse HEAD:docker)
  20. docker pull docker.0k.io/gogocarto-builder:${docker_tree_hash} &&
  21. docker tag docker.0k.io/gogocarto-builder:${docker_tree_hash} docker_gogocarto
  22. #+end_src
  23. You still need to do (as of <2020-10-20 Tue>):
  24. - get the latest source code
  25. - =make up= to launch de containers with the images
  26. - =make shell= from the latest git repos
  27. - =make init= in the container
  28. ** Full release is cached on =docker.0k.io/downloads=
  29. This is the content of the source tree, once populated by =make init=.
  30. *** mongodb is not included
  31. As of <2020-10-23 Fri>, the =Makefile='s =init= target is:
  32. #+begin_src sh
  33. $ grep ^init Makefile -A1
  34. init: install assets load-fixtures fix-perms ## Initialize the project
  35. #+end_src
  36. Note that ``load-fixtures`` target is actually mongodb initialization:
  37. #+begin_src sh
  38. load-fixtures: ## Create the DB schema, generate DB classes and load fixtures
  39. $(SYMFONY) doctrine:mongodb:schema:create
  40. $(SYMFONY) doctrine:mongodb:generate:hydrators
  41. $(SYMFONY) doctrine:mongodb:generate:proxies
  42. $(SYMFONY) doctrine:mongodb:fixtures:load -n
  43. #+end_src
  44. This will be done in the =hooks/mongo_database-relation-joined= accordingly.
  45. *** o create the full data release bundle this is what was made:
  46. #+begin_src sh
  47. ## correct bundles links (no idea if it is needed)
  48. (
  49. cd web/bundles
  50. for i in *; do
  51. link_target=$(readlink "$i")
  52. ln -sf /opt/apps/gogocarto"${link_target#/var/www}" "$i"
  53. done
  54. )
  55. ## Force original versions
  56. git co web/index.php config/packages/doctrine_mongodb.yaml bin/console
  57. sed -ri "s/^(<\?php)/\1\n\ini_set('memory.limit', '1024M');/" \
  58. web/index.php bin/console
  59. sed -ri "s%dirname\(__DIR__\)\.'%'/opt/apps/gogocarto%g" \
  60. web/index.php
  61. commit_sha=$(git describe HEAD --tags)
  62. tar cjv \
  63. bin web vendor config src templates translations \
  64. --exclude=.git --exclude=.gitignore \
  65. > gogocarto-${commit_sha}.tar.bz2
  66. #+end_src
  67. This is still far from being perfect, I wonder if we can just remove
  68. all non '\*.{php,yml,js}' files. I noticed many many unrelated files in
  69. =vendor/=.
  70. We need =bin= for symphony utilities that allows to setup things.
  71. * Roadmap
  72. ** TODO mongo / the default database name is probably not correctly set.
  73. Indeed, it seems it is defaulted to =gogocarto_default= and I didn't find
  74. yet how to set it. There's a connection with SAAS mode I think.