Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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 = track-changes
  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. format:
  17. $(DOCKER_COMPOSE) run --rm test_unit npm run format || true
  18. format_fix:
  19. $(DOCKER_COMPOSE) run --rm test_unit npm run format:fix
  20. lint:
  21. $(DOCKER_COMPOSE) run --rm test_unit npm run lint || true
  22. test: format lint test_unit test_acceptance
  23. test_unit:
  24. @[ ! -d test/unit ] && echo "track-changes has no unit tests" || $(DOCKER_COMPOSE) run --rm test_unit
  25. test_acceptance: test_clean test_acceptance_pre_run test_acceptance_run
  26. test_acceptance_debug: test_clean test_acceptance_pre_run test_acceptance_run_debug
  27. test_acceptance_run:
  28. @[ ! -d test/acceptance ] && echo "track-changes has no acceptance tests" || $(DOCKER_COMPOSE) run --rm test_acceptance
  29. test_acceptance_run_debug:
  30. @[ ! -d test/acceptance ] && echo "track-changes 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
  31. test_clean:
  32. $(DOCKER_COMPOSE) down -v -t 0
  33. test_acceptance_pre_run:
  34. @[ ! -f test/acceptance/js/scripts/pre-run ] && echo "track-changes has no pre acceptance tests task" || $(DOCKER_COMPOSE) run --rm test_acceptance test/acceptance/js/scripts/pre-run
  35. build:
  36. docker build --pull --tag ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
  37. --tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
  38. .
  39. tar:
  40. $(DOCKER_COMPOSE) up tar
  41. publish:
  42. docker push $(DOCKER_REPO)/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
  43. .PHONY: clean test test_unit test_acceptance test_clean build publish