2023-11-23 05:40:13 -05:00
all : test -e 2e
2024-05-30 03:12:56 -04: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 06:54:50 -04: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-06-11 07:01:21 -04:00
export IMAGE_TAG_PRO ?= quay.io/sharelatex/sharelatex-pro:latest
2024-07-10 10:00:41 -04:00
export CYPRESS_SHARD ?=
export COMPOSE_PROJECT_NAME ?= test
2024-05-30 03:13:24 -04:00
2024-08-30 06:54:50 -04: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 08:02:23 -04: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 07:05:06 -04:00
2023-11-23 05:40:13 -05:00
test-e2e :
2024-08-30 06:54:50 -04:00
docker compose up --no-log-prefix --exit-code-from= e2e e2e
2023-11-23 05:40:13 -05:00
2024-08-30 06:54:50 -04:00
test-e2e-open :
docker compose up --no-log-prefix --exit-code-from= e2e-open e2e-open
2024-05-30 03:12:56 -04:00
clean :
docker compose down --volumes --timeout 0
2024-07-10 10:00:41 -04: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 05:56:56 -04:00
docker compose build host-admin
2024-07-10 10:00:41 -04: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 03:13:24 -04:00
echo -n " $$ ALL_TEX_LIVE_DOCKER_IMAGES " | xargs -d, -I% \
2024-08-30 06:54:50 -04:00
sh -exc 'tag=%; re_tag=quay.io/sharelatex/$${tag#*/*/}; docker pull $$tag; docker tag $$tag $$re_tag'
2024-07-10 10:00:41 -04:00
prefetch_custom : prefetch_old
prefetch_old :
2024-06-11 07:01:21 -04: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 11:51:26 -05:00
2024-07-29 05:56:56 -04: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 11:51:26 -05:00
.PHONY : test -e 2e test -e 2e -open