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.

101 lines
2.8 KiB

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