Makefile 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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.0
  5. BUILD_NUMBER ?= local
  6. BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD)
  7. PROJECT_NAME = clsi
  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. docker-compose ${DOCKER_COMPOSE_FLAGS}
  13. clean:
  14. rm -f app.js
  15. rm -rf app/js
  16. rm -rf test/unit/js
  17. rm -rf test/acceptance/js
  18. test: test_unit test_acceptance
  19. test_unit:
  20. @[ -d test/unit ] && $(DOCKER_COMPOSE) run --rm test_unit -- ${MOCHA_ARGS} || echo "clsi has no unit tests"
  21. test_acceptance: test_clean # clear the database before each acceptance test run
  22. @[ -d test/acceptance ] && $(DOCKER_COMPOSE) run --rm test_acceptance -- ${MOCHA_ARGS} || echo "clsi has no acceptance tests"
  23. test_clean:
  24. $(DOCKER_COMPOSE) down -t 0
  25. build:
  26. docker build --pull --tag quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) .
  27. publish:
  28. docker push quay.io/sharelatex/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
  29. ci:
  30. # On the CI server, we want to run our tests in the image that we
  31. # have built for deployment, which is what the docker-compose.ci.yml
  32. # override does.
  33. PROJECT_NAME=$(PROJECT_NAME) \
  34. BRANCH_NAME=$(BRANCH_NAME) \
  35. BUILD_NUMBER=$(BUILD_NUMBER) \
  36. DOCKER_COMPOSE_FLAGS="-f docker-compose.ci.yml" \
  37. $(MAKE) build test publish
  38. .PHONY: clean test test_unit test_acceptance test_clean build publish