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
2.7 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. ROPTS=-zav --no-p --chmod=u=rw,g=rw,o=r --delete --exclude=www/.htaccess --exclude=.svn --exclude=.git --exclude=*.mtt --exclude=tpl/css --exclude=www/file --exclude=*node_modules* --exclude=*.php --exclude=tests.n
  2. LANG=fr
  3. PLUGINS?=0
  4. ENV?="dev"
  5. #To compile project with plugins, add PLUGINS=1 or type `export PLUGINS=1`
  6. install:
  7. #copy config file from template
  8. #cp config.xml.dist config.xml
  9. @if [ $(ENV) = "dev" ]; then \
  10. make install_dev; \
  11. fi
  12. #setup dev environnement from source
  13. install_dev:
  14. #set config file to debug=1
  15. #@sed -e 's?debug=.*?debug="1"?g' --in-place config.xml
  16. #install haxe dependencies in .haxelib
  17. haxelib newrepo
  18. haxelib -always install cagette.hxml
  19. haxelib -always install cagetteJs.hxml
  20. #template tools
  21. haxelib run templo
  22. sudo mv temploc2 /usr/bin
  23. #extra plugins
  24. @if [ $(PLUGINS) = 1 ]; then \
  25. haxelib git cagette-pro git@bitbucket.org:bubar/cagette-pro.git; \
  26. haxelib git cagette-hosted git@bitbucket.org:bubar/cagette-hosted.git; \
  27. haxelib git cagette-wholesale-order git@github.com:bablukid/cagette-wholesale-order.git; \
  28. fi
  29. #install npm dependencies
  30. npm install
  31. npm run libs:dev
  32. npm run build:js
  33. #compile
  34. @make css
  35. @make compile
  36. @make frontend
  37. @make templates
  38. @echo "Well, it looks like everything is fine : librairies are installed, backend and frontend has been compiled !"
  39. #compile backend to Neko
  40. compile:
  41. @if [ $(PLUGINS) = 1 ]; then \
  42. echo "compile Cagette.net with plugins"; \
  43. haxe cagetteAllPlugins.hxml; \
  44. else \
  45. echo "compile Cagette.net core"; \
  46. haxe cagette.hxml; \
  47. fi
  48. #compile SASS files to CSS
  49. css:
  50. npm run build:sass
  51. #compile frontend to JS
  52. frontend:
  53. @if [ $(PLUGINS) = 1 ]; then \
  54. haxe cagetteAllPluginsJs.hxml; \
  55. else \
  56. haxe cagetteJs.hxml; \
  57. fi
  58. mkdir -p tmp
  59. chown www-data:www-data tmp
  60. #update POT file from source
  61. i18n:
  62. haxe potGeneration.hxml
  63. #compile templates in each language, required for production env.
  64. templates:
  65. mkdir -p lang/master/tmp
  66. haxe cagette.hxml -D i18n_generation
  67. @make LANG=fr ctemplates
  68. msgfmt www/lang/texts_fr.po -o www/lang/texts_fr.mo
  69. chown www-data:www-data -R www
  70. ctemplates:
  71. # (cd lang/$(LANG)/tpl; temploc2 -macros macros.mtt -output ../tmp/ *.mtt */*.mtt */*/*.mtt */*/*/*.mtt */*/*/*/*.mtt)
  72. (cd lang/$(LANG)/tpl; temploc2 -macros macros.mtt -output ../tmp/ *.mtt */*.mtt */*/*.mtt)
  73. #Compile and run unit tests
  74. tests:
  75. @if [ $(PLUGINS) = 1 ]; then \
  76. haxe testsPlugins.hxml; \
  77. else \
  78. haxe tests.hxml; \
  79. fi
  80. @docker-compose run --workdir="/var/www/www" neko neko tests.n mysql://root:root@mysql/tests
  81. cp_plugin:
  82. cp -R .haxelib/cagette-hosted/git/tpl/* lang/master/tpl/plugin/hosted/
  83. cp -R .haxelib/cagette-pro/git/tpl/* lang/master/tpl/plugin/pro/
  84. cp -R .haxelib/cagette-wholesale-order/git/tpl/* lang/master/tpl/plugin/who/