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.

112 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. ** 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 docker-build &&
  22. docker tag gogocarto_gogocarto:latest 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} gogocarto_gogocarto:latest
  26. fi
  27. make up &&
  28. docker-compose exec gogocarto make init
  29. #+end_src
  30. Last =make init= is building the actual code to be served.
  31. ** Full release is cached on =docker.0k.io/downloads=
  32. This is the content of the source tree, once populated by =make init=.
  33. *** mongodb initialisation is not included in source and is handled by the charm
  34. As of <2020-10-23 Fri>, the =Makefile='s =init= target is:
  35. #+begin_src sh
  36. $ grep ^init Makefile -A1
  37. init: install assets load-fixtures fix-perms ## Initialize the project
  38. #+end_src
  39. Note that =load-fixtures= target is actually the mongodb initialization:
  40. #+begin_src sh
  41. load-fixtures: ## Create the DB schema, generate DB classes and load fixtures
  42. $(SYMFONY) doctrine:mongodb:schema:create
  43. $(SYMFONY) doctrine:mongodb:generate:hydrators
  44. $(SYMFONY) doctrine:mongodb:generate:proxies
  45. $(SYMFONY) doctrine:mongodb:fixtures:load -n
  46. #+end_src
  47. This will be done in the =hooks/mongo_database-relation-joined= accordingly.
  48. *** create the full data release bundle this is what was made
  49. #+begin_src sh
  50. ## correct bundles links (no idea if it is needed)
  51. (
  52. cd web/bundles
  53. for i in *; do
  54. link_target=$(readlink "$i")
  55. ln -sf /opt/apps/gogocarto"${link_target#/var/www}" "$i"
  56. done
  57. )
  58. ## Force original versions
  59. git co web/index.php config/packages/doctrine_mongodb.yaml bin/console
  60. sed -ri "s/^(<\?php)/\1\n\ini_set('memory.limit', '1024M');/" \
  61. web/index.php bin/console
  62. sed -ri "s%dirname\(__DIR__\)\.'%'/opt/apps/gogocarto%g" \
  63. web/index.php
  64. sed -ri "s/\"use_as_saas=%env\(resolve:USE_AS_SAAS\)%\/%env\(resolve:DATABASE_NAME\)%\"/'%env(resolve:DATABASE_NAME)%'/g" \
  65. config/packages/doctrine_mongodb.yaml
  66. ## Add missing tags in git
  67. git log --format="%H" -- config/parameters.yaml |
  68. while read h; do
  69. printf "%s\t%s\n" "$h" "$(git show $h:config/parameters.yaml |
  70. grep version |
  71. cut -f 2 -d ":" |
  72. xargs echo)"
  73. done | uniq -f 1 |
  74. while read a b; do
  75. git tag "$b" "$a" 2>/dev/null
  76. done
  77. commit_sha=$(git describe HEAD --tags)
  78. tar cjv \
  79. --exclude=.git --exclude=.gitignore --exclude=.github \
  80. --owner=root --group=root \
  81. bin web vendor config src templates translations \
  82. > gogocarto-${commit_sha}.tar.bz2
  83. #+end_src
  84. This is still far from being perfect, I wonder if we can just remove
  85. all non '\*.{php,yml,js}' files. I noticed many many unrelated files in
  86. =vendor/=.
  87. We need =bin= for symphony utilities that allows to setup things.