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.

111 lines
3.6 KiB

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