makefile 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. # Makefile to compile and run tests with phantomjs
  2. #
  3. # "scyt/nodejs" container contains all necessary dependencies to run nodejs with npm, bower and phantomjs browser.
  4. #
  5. # The command below does the following steps:
  6. # - Runs the 10.4.16.33/scytl/nodejs container (-rm = The container is removed once the execution is finished)
  7. # - Mounts the project (current dir) to container's /app/ directory (with write privileges)
  8. # - Sets http_proxy (Otherwise ONE machines cannot fetch depedencies. http_proxy needs to be disabled to non-ONE machines, since the proxy is only visible by ONE)
  9. # - Runs 'make -B compile' _inside_ the container which: (-B is to force rebuild at Makefile)
  10. # - Runs npm install
  11. # - Runs bower install (passes --allow-root, otherwise bower fails with root user)
  12. # - Runs grunt (Which use karma to launch firefox for testing, http_proxy is unset so that firefox can connect to karma for testing)
  13. # By default docker target is executed
  14. all: run
  15. # This is run on the host to launch the container
  16. ci: pull run
  17. pull:
  18. docker pull 10.4.16.33/scytl/nodejs
  19. run:
  20. docker run -e GIT_COMMIT=$(GIT_COMMIT) -e BUILD_NUMBER=$(BUILD_NUMBER) -e BUILD_ID=$(BUILD_ID) -e http_proxy=http://hproxy.scytl.net:8080 -e https_proxy=http://hproxy.scytl.net:8080 -P -rm -a=stdout -v "`pwd`:/app/" -p 5999 -w /app -i -t 10.4.16.33/scytl/nodejs make -B compile
  21. # This is run on the container to build the project
  22. compile:
  23. npm install --unsafe-perm
  24. npm run build
  25. publish_dev:
  26. npm install --unsafe-perm
  27. npm run gulp bump:dev
  28. npm run build
  29. npm publish
  30. publish_rc:
  31. npm install --unsafe-perm
  32. npm run gulp bump:rc
  33. npm run build
  34. npm publish
  35. git add makefile package.json
  36. git commit -m "new release candidate version"
  37. node -p "package = require('./package.json'); package.name+'-'+package.version" | xargs git tag
  38. node -p "package = require('./package.json'); package.name+'-'+package.version" | xargs git push origin
  39. git push origin HEAD
  40. release:
  41. npm install --unsafe-perm
  42. npm run gulp bump:release
  43. npm run build
  44. npm publish
  45. git add makefile package.json
  46. git commit -m "new release version"
  47. node -p "package = require('./package.json'); package.name+'-'+package.version" | xargs git tag
  48. node -p "package = require('./package.json'); package.name+'-'+package.version" | xargs git push origin
  49. git push origin HEAD