Makefile 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. all: test-e2e
  2. # We are updating the docker compose config via the host-admin service.
  3. # The host-admin service is running inside docker and has its own file-system layout.
  4. # We need to have both file-system layouts agree on the path for the docker compose project.
  5. # Notable the container labels com.docker.compose.project.working_dir and com.docker.compose.project.config_files need to match when creating containers from the docker host (how you started things) and from host-admin (how tests reconfigure the instance).
  6. export PWD = $(shell pwd)
  7. export TEX_LIVE_DOCKER_IMAGE ?= quay.io/sharelatex/texlive-full:2023.1
  8. export ALL_TEX_LIVE_DOCKER_IMAGES ?= quay.io/sharelatex/texlive-full:2023.1,quay.io/sharelatex/texlive-full:2022.1
  9. export IMAGE_TAG_PRO ?= quay.io/sharelatex/sharelatex-pro:latest
  10. export CYPRESS_SHARD ?=
  11. export COMPOSE_PROJECT_NAME ?= test
  12. test-e2e-native: build_mailtrap
  13. docker compose -f docker-compose.yml -f docker-compose.native.yml up --build --no-log-prefix sharelatex host-admin -d
  14. CYPRESS_ADMIN_CLIENT_URL='http://localhost:8081' CYPRESS_GIT_BRIDGE_PUBLIC_HOST='localhost' CYPRESS_SAML_PUBLIC_HOST='localhost:8082' CYPRESS_OVERLEAF_PUBLIC_HOST='localhost:8082' npm run cypress:open
  15. test-e2e:
  16. docker compose up --build --no-log-prefix --exit-code-from=e2e e2e
  17. test-e2e-open: build_mailtrap
  18. docker compose up --build --no-log-prefix --exit-code-from=e2e-open e2e-open
  19. clean:
  20. docker compose down --volumes --timeout 0
  21. prefetch: prefetch_default
  22. prefetch_default: prefetch_default_compose
  23. prefetch_default_compose:
  24. docker compose pull e2e mongo redis
  25. prefetch_default: prefetch_default_compose_build
  26. prefetch_default_compose_build:
  27. docker compose build host-admin
  28. prefetch: prefetch_custom
  29. prefetch_custom: prefetch_custom_compose_pull
  30. prefetch_custom_compose_pull:
  31. docker compose pull saml ldap
  32. prefetch_custom: prefetch_custom_texlive
  33. prefetch_custom_texlive:
  34. echo -n "$$ALL_TEX_LIVE_DOCKER_IMAGES" | xargs -d, -I% \
  35. sh -exc 'tag=%; re_tag=quay.io/sharelatex/$${tag#*/}; docker pull $$tag; docker tag $$tag $$re_tag'
  36. prefetch_custom: prefetch_old
  37. prefetch_old:
  38. docker pull $(IMAGE_TAG_PRO:latest=4.2)
  39. docker pull $(IMAGE_TAG_PRO:latest=5.0.1-RC1)
  40. docker pull $(IMAGE_TAG_PRO:latest=5.0)
  41. # Google Cloud Build runs on a very ancient Docker version that does not support the subdir flag.
  42. # Use services -> mailtrap -> build -> context = https://github.com/dbck/docker-mailtrap.git#v1.5.0:build in docker-compose.yml eventually.
  43. prefetch_default_compose_build: build_mailtrap
  44. build_mailtrap:
  45. git clone https://github.com/dbck/docker-mailtrap.git || true && cd docker-mailtrap && git checkout v1.5.0
  46. docker build -t mailtrap docker-mailtrap/build
  47. .PHONY: test-e2e test-e2e-open