2023-11-23 10:40:13 +00:00
all : test -e 2e
2024-05-30 07:12:56 +00:00
# We are updating the docker compose config via the host-admin service.
# The host-admin service is running inside docker and has its own file-system layout.
# We need to have both file-system layouts agree on the path for the docker compose project.
# 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).
export PWD = $( shell pwd )
2024-08-30 10:54:50 +00:00
export TEX_LIVE_DOCKER_IMAGE ?= gcr.io/overleaf-ops/texlive-full:2023.1
export ALL_TEX_LIVE_DOCKER_IMAGES ?= gcr.io/overleaf-ops/texlive-full:2023.1,gcr.io/overleaf-ops/texlive-full:2022.1
2024-09-04 09:36:45 +00:00
export IMAGE_TAG_PRO ?= us-east1-docker.pkg.dev/overleaf-ops/ol-docker/pro:latest
2024-07-10 14:00:41 +00:00
export CYPRESS_SHARD ?=
export COMPOSE_PROJECT_NAME ?= test
2024-05-30 07:13:24 +00:00
2024-08-30 10:54:50 +00:00
test-e2e-native :
docker compose -f docker-compose.yml -f docker-compose.native.yml up --no-log-prefix sharelatex host-admin -d
2024-08-30 12:02:23 +00:00
CYPRESS_HOST_ADMIN_URL = 'http://localhost:8081' \
CYPRESS_SAML_URL = 'http://localhost:8082' \
CYPRESS_MAILTRAP_URL = 'http://localhost:8083' \
npm run cypress:open
2024-06-17 11:05:06 +00:00
2023-11-23 10:40:13 +00:00
test-e2e :
2024-08-30 10:54:50 +00:00
docker compose up --no-log-prefix --exit-code-from= e2e e2e
2023-11-23 10:40:13 +00:00
2024-08-30 10:54:50 +00:00
test-e2e-open :
docker compose up --no-log-prefix --exit-code-from= e2e-open e2e-open
2024-05-30 07:12:56 +00:00
clean :
docker compose down --volumes --timeout 0
2024-07-10 14:00:41 +00:00
prefetch : prefetch_default
prefetch_default : prefetch_default_compose
prefetch_default_compose :
docker compose pull e2e mongo redis
prefetch_default : prefetch_default_compose_build
prefetch_default_compose_build :
2024-07-29 09:56:56 +00:00
docker compose build host-admin
2024-07-10 14:00:41 +00:00
prefetch : prefetch_custom
prefetch_custom : prefetch_custom_compose_pull
prefetch_custom_compose_pull :
docker compose pull saml ldap
prefetch_custom : prefetch_custom_texlive
prefetch_custom_texlive :
2024-05-30 07:13:24 +00:00
echo -n " $$ ALL_TEX_LIVE_DOCKER_IMAGES " | xargs -d, -I% \
2024-08-30 10:54:50 +00:00
sh -exc 'tag=%; re_tag=quay.io/sharelatex/$${tag#*/*/}; docker pull $$tag; docker tag $$tag $$re_tag'
2024-07-10 14:00:41 +00:00
prefetch_custom : prefetch_old
prefetch_old :
2024-06-11 11:01:21 +00:00
docker pull $( IMAGE_TAG_PRO:latest= 4.2)
docker pull $( IMAGE_TAG_PRO:latest= 5.0.1-RC1)
docker pull $( IMAGE_TAG_PRO:latest= 5.0)
2024-02-08 16:51:26 +00:00
2024-07-29 09:56:56 +00:00
# Google Cloud Build runs on a very ancient Docker version that does not support the subdir flag.
# Use services -> mailtrap -> build -> context = https://github.com/dbck/docker-mailtrap.git#v1.5.0:build in docker-compose.yml eventually.
prefetch_default_compose_build : build_mailtrap
build_mailtrap :
git clone https://github.com/dbck/docker-mailtrap.git || true && cd docker-mailtrap && git checkout v1.5.0
docker build -t mailtrap docker-mailtrap/build
2024-02-08 16:51:26 +00:00
.PHONY : test -e 2e test -e 2e -open