Makefile 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. BUILD_NUMBER ?= local
  5. BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
  6. PROJECT_NAME = document-updater
  7. DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml
  8. DOCKER_COMPOSE := BUILD_NUMBER=$(BUILD_NUMBER) \
  9. BRANCH_NAME=$(BRANCH_NAME) \
  10. PROJECT_NAME=$(PROJECT_NAME) \
  11. MOCHA_GREP=${MOCHA_GREP} \
  12. docker-compose ${DOCKER_COMPOSE_FLAGS}
  13. clean:
  14. docker rmi ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
  15. docker rmi gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
  16. rm -f app.js
  17. rm -rf app/js
  18. rm -rf test/unit/js
  19. rm -rf test/acceptance/js
  20. test: test_unit test_acceptance
  21. test_unit:
  22. @[ ! -d test/unit ] && echo "document-updater has no unit tests" || $(DOCKER_COMPOSE) run --rm test_unit
  23. test_acceptance: test_clean test_acceptance_pre_run test_acceptance_run
  24. test_acceptance_debug: test_clean test_acceptance_pre_run test_acceptance_run_debug
  25. test_acceptance_run:
  26. @[ ! -d test/acceptance ] && echo "document-updater has no acceptance tests" || $(DOCKER_COMPOSE) run --rm test_acceptance
  27. test_acceptance_run_debug:
  28. @[ ! -d test/acceptance ] && echo "document-updater 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
  29. test_clean:
  30. $(DOCKER_COMPOSE) down -v -t 0
  31. test_acceptance_pre_run:
  32. @[ ! -f test/acceptance/js/scripts/pre-run ] && echo "document-updater has no pre acceptance tests task" || $(DOCKER_COMPOSE) run --rm test_acceptance test/acceptance/js/scripts/pre-run
  33. build:
  34. docker build --pull --tag ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
  35. --tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
  36. .
  37. tar:
  38. $(DOCKER_COMPOSE) up tar
  39. publish:
  40. docker push $(DOCKER_REPO)/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
  41. .PHONY: clean test test_unit test_acceptance test_clean build publish