fork 0k-charms
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.

98 lines
3.1 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. ** Updating
  13. This process will ensure to avoid rebuilding the gigantic intermediate
  14. image needed (with apache and build/install tools).
  15. You need to run this from the root of a code checkout of:
  16. https://gitlab.adullact.net/pixelhumain/GoGoCarto
  17. #+begin_src sh
  18. docker_tree_hash=$(git rev-parse HEAD:docker)
  19. ## Intermediate docker image is cached on docker.0k.io if needed
  20. if ! docker pull docker.0k.io/gogocarto-builder:${docker_tree_hash}; then
  21. make build &&
  22. docker tag docker_gogocarto docker.0k.io/gogocarto-builder:${docker_tree_hash} &&
  23. docker push docker.0k.io/gogocarto-builder:${docker_tree_hash}
  24. else
  25. docker tag docker.0k.io/gogocarto-builder:${docker_tree_hash} docker_gogocarto
  26. fi
  27. make up &&
  28. docker-compose -f docker/docker-compose.yml exec gogocarto make init
  29. #+end_src
  30. ** Full release is cached on =docker.0k.io/downloads=
  31. This is the content of the source tree, once populated by =make init=.
  32. *** mongodb initialisation is not included in source and is handled by the charm
  33. As of <2020-10-23 Fri>, the =Makefile='s =init= target is:
  34. #+begin_src sh
  35. $ grep ^init Makefile -A1
  36. init: install assets load-fixtures fix-perms ## Initialize the project
  37. #+end_src
  38. Note that =load-fixtures= target is actually the mongodb initialization:
  39. #+begin_src sh
  40. load-fixtures: ## Create the DB schema, generate DB classes and load fixtures
  41. $(SYMFONY) doctrine:mongodb:schema:create
  42. $(SYMFONY) doctrine:mongodb:generate:hydrators
  43. $(SYMFONY) doctrine:mongodb:generate:proxies
  44. $(SYMFONY) doctrine:mongodb:fixtures:load -n
  45. #+end_src
  46. This will be done in the =hooks/mongo_database-relation-joined= accordingly.
  47. *** create the full data release bundle this is what was made
  48. #+begin_src sh
  49. ## correct bundles links (no idea if it is needed)
  50. (
  51. cd web/bundles
  52. for i in *; do
  53. link_target=$(readlink "$i")
  54. ln -sf /opt/apps/gogocarto"${link_target#/var/www}" "$i"
  55. done
  56. )
  57. ## Force original versions
  58. git co web/index.php config/packages/doctrine_mongodb.yaml bin/console
  59. sed -ri "s/^(<\?php)/\1\n\ini_set('memory.limit', '1024M');/" \
  60. web/index.php bin/console
  61. sed -ri "s%dirname\(__DIR__\)\.'%'/opt/apps/gogocarto%g" \
  62. web/index.php
  63. sed -ri "s/gogocarto_default/'%env(MONGODB_DATABASE)%_default'/g" \
  64. config/packages/doctrine_mongodb.yaml
  65. commit_sha=$(git describe HEAD --tags)
  66. tar cjv \
  67. bin web vendor config src templates translations \
  68. --exclude=.git --exclude=.gitignore \
  69. --owner=root --group=root \
  70. > gogocarto-${commit_sha}.tar.bz2
  71. #+end_src
  72. This is still far from being perfect, I wonder if we can just remove
  73. all non '\*.{php,yml,js}' files. I noticed many many unrelated files in
  74. =vendor/=.
  75. We need =bin= for symphony utilities that allows to setup things.