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.

97 lines
2.7 KiB

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. @echo "Well, it looks like everything is fine : librairies are installed, backend and frontend has been compiled !"
  38. #compile backend to Neko
  39. compile:
  40. @if [ $(PLUGINS) = 1 ]; then \
  41. echo "compile Cagette.net with plugins"; \
  42. haxe cagetteAllPlugins.hxml; \
  43. else \
  44. echo "compile Cagette.net core"; \
  45. haxe cagette.hxml; \
  46. fi
  47. #compile SASS files to CSS
  48. css:
  49. npm run build:sass
  50. #compile frontend to JS
  51. frontend:
  52. @if [ $(PLUGINS) = 1 ]; then \
  53. haxe cagetteAllPluginsJs.hxml; \
  54. else \
  55. haxe cagetteJs.hxml; \
  56. fi
  57. #update POT file from source
  58. i18n:
  59. haxe potGeneration.hxml
  60. #compile templates in each language, required for production env.
  61. templates:
  62. haxe cagette.hxml -D i18n_generation
  63. mkdir -p lang/master/tmp
  64. @make LANG=fr ctemplates
  65. #@make LANG=en ctemplates
  66. #@make LANG=de ctemplates
  67. msgfmt www/lang/texts_fr.po -o www/lang/texts_fr.mo
  68. chown www-data:www-data -R www
  69. ctemplates:
  70. # (cd lang/$(LANG)/tpl; temploc2 -macros macros.mtt -output ../tmp/ *.mtt */*.mtt */*/*.mtt */*/*/*.mtt */*/*/*/*.mtt)
  71. (cd lang/$(LANG)/tpl; temploc2 -macros macros.mtt -output ../tmp/ *.mtt */*.mtt */*/*.mtt)
  72. #Compile and run unit tests
  73. tests:
  74. @if [ $(PLUGINS) = 1 ]; then \
  75. haxe testsPlugins.hxml; \
  76. else \
  77. haxe tests.hxml; \
  78. fi
  79. @docker-compose run --workdir="/var/www/www" neko neko tests.n mysql://root:root@mysql/tests
  80. cp_plugin:
  81. cp -R .haxelib/cagette-hosted/git/tpl/* lang/master/tpl/plugin/hosted/
  82. cp -R .haxelib/cagette-pro/git/tpl/* lang/master/tpl/plugin/pro/
  83. cp -R .haxelib/cagette-wholesale-order/git/tpl/* lang/master/tpl/plugin/who/