Makefile 1.8 KB

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