Makefile 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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:
  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:
  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
  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. .PHONY: test-e2e test-e2e-open