Makefile 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. # This file was auto-generated, do not edit it directly.
  2. # Instead run bin/update_build_scripts from
  3. # https://github.com/sharelatex/sharelatex-dev-environment
  4. # Version: 1.3.5
  5. BUILD_NUMBER ?= local
  6. BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
  7. PROJECT_NAME = chat
  8. DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
  9. DOCKER_COMPOSE := BUILD_NUMBER=$(BUILD_NUMBER) \
  10. BRANCH_NAME=$(BRANCH_NAME) \
  11. PROJECT_NAME=$(PROJECT_NAME) \
  12. MOCHA_GREP=${MOCHA_GREP} \
  13. docker-compose ${DOCKER_COMPOSE_FLAGS}
  14. clean:
  15. docker rmi ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
  16. docker rmi gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
  17. format:
  18. $(DOCKER_COMPOSE) run --rm test_unit npm run format
  19. format_fix:
  20. $(DOCKER_COMPOSE) run --rm test_unit npm run format:fix
  21. lint:
  22. $(DOCKER_COMPOSE) run --rm test_unit npm run lint
  23. test: format lint test_unit test_acceptance
  24. test_unit:
  25. @[ ! -d test/unit ] && echo "chat has no unit tests" || $(DOCKER_COMPOSE) run --rm test_unit
  26. test_acceptance: test_clean test_acceptance_pre_run test_acceptance_run
  27. test_acceptance_debug: test_clean test_acceptance_pre_run test_acceptance_run_debug
  28. test_acceptance_run:
  29. @[ ! -d test/acceptance ] && echo "chat has no acceptance tests" || $(DOCKER_COMPOSE) run --rm test_acceptance
  30. test_acceptance_run_debug:
  31. @[ ! -d test/acceptance ] && echo "chat has no acceptance tests" || $(DOCKER_COMPOSE) run -p 127.0.0.9:19999:19999 --rm test_acceptance npm run test:acceptance -- --inspect=0.0.0.0:19999 --inspect-brk
  32. test_clean:
  33. $(DOCKER_COMPOSE) down -v -t 0
  34. test_acceptance_pre_run:
  35. @[ ! -f test/acceptance/js/scripts/pre-run ] && echo "chat has no pre acceptance tests task" || $(DOCKER_COMPOSE) run --rm test_acceptance test/acceptance/js/scripts/pre-run
  36. build:
  37. docker build --pull --tag ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
  38. --tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
  39. .
  40. tar:
  41. $(DOCKER_COMPOSE) up tar
  42. publish:
  43. docker push $(DOCKER_REPO)/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
  44. .PHONY: clean test test_unit test_acceptance test_clean build publish