|
@@ -24,7 +24,6 @@ DOCKER_COMPOSE_TEST_UNIT = \
|
|
|
|
|
|
|
|
clean:
|
|
clean:
|
|
|
-docker rmi ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
|
|
-docker rmi ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
|
|
|
- -docker rmi gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
|
|
|
|
|
-docker rmi us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
|
|
-docker rmi us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER)
|
|
|
-$(DOCKER_COMPOSE_TEST_UNIT) down --rmi local
|
|
-$(DOCKER_COMPOSE_TEST_UNIT) down --rmi local
|
|
|
-$(DOCKER_COMPOSE_TEST_ACCEPTANCE) down --rmi local
|
|
-$(DOCKER_COMPOSE_TEST_ACCEPTANCE) down --rmi local
|
|
@@ -35,24 +34,35 @@ MONOREPO=$(shell cd ../../ && pwd)
|
|
|
# Eslint and prettier (plus some configs) are on the root.
|
|
# Eslint and prettier (plus some configs) are on the root.
|
|
|
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:18.20.2 npm run --silent
|
|
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:18.20.2 npm run --silent
|
|
|
|
|
|
|
|
|
|
+RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) npm run --silent
|
|
|
|
|
+
|
|
|
# Same but from the top of the monorepo
|
|
# Same but from the top of the monorepo
|
|
|
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:18.20.2 npm run --silent
|
|
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:18.20.2 npm run --silent
|
|
|
|
|
|
|
|
format:
|
|
format:
|
|
|
$(RUN_LINTING) format
|
|
$(RUN_LINTING) format
|
|
|
|
|
|
|
|
|
|
+format_ci:
|
|
|
|
|
+ $(RUN_LINTING_CI) format
|
|
|
|
|
+
|
|
|
format_fix:
|
|
format_fix:
|
|
|
$(RUN_LINTING) format:fix
|
|
$(RUN_LINTING) format:fix
|
|
|
|
|
|
|
|
lint:
|
|
lint:
|
|
|
$(RUN_LINTING) lint
|
|
$(RUN_LINTING) lint
|
|
|
|
|
|
|
|
|
|
+lint_ci:
|
|
|
|
|
+ $(RUN_LINTING_CI) lint
|
|
|
|
|
+
|
|
|
lint_fix:
|
|
lint_fix:
|
|
|
$(RUN_LINTING) lint:fix
|
|
$(RUN_LINTING) lint:fix
|
|
|
|
|
|
|
|
typecheck:
|
|
typecheck:
|
|
|
$(RUN_LINTING) types:check
|
|
$(RUN_LINTING) types:check
|
|
|
|
|
|
|
|
|
|
+typecheck_ci:
|
|
|
|
|
+ $(RUN_LINTING_CI) types:check
|
|
|
|
|
+
|
|
|
test: format lint typecheck test_unit test_acceptance
|
|
test: format lint typecheck test_unit test_acceptance
|
|
|
|
|
|
|
|
test_unit:
|
|
test_unit:
|
|
@@ -96,30 +106,14 @@ benchmarks:
|
|
|
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
|
|
$(DOCKER_COMPOSE_TEST_ACCEPTANCE) run --rm test_acceptance npm run benchmarks
|
|
|
|
|
|
|
|
build:
|
|
build:
|
|
|
- docker pull gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \
|
|
|
|
|
- || docker pull gcr.io/overleaf-ops/$(PROJECT_NAME):main-deps \
|
|
|
|
|
- || echo 'nothing cached for gcr.io/overleaf-ops'
|
|
|
|
|
- docker pull us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME)-deps \
|
|
|
|
|
- || docker pull us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):main-deps \
|
|
|
|
|
- || echo 'nothing cached for us-east1-docker.pkg.dev/overleaf-ops/ol-docker'
|
|
|
|
|
docker build \
|
|
docker build \
|
|
|
- --pull \
|
|
|
|
|
|
|
+ --pull \
|
|
|
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
|
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
|
|
- --tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \
|
|
|
|
|
- --cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \
|
|
|
|
|
- --cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):main-deps \
|
|
|
|
|
- --tag us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME)-deps \
|
|
|
|
|
- --cache-from us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME)-deps \
|
|
|
|
|
- --cache-from us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):main-deps \
|
|
|
|
|
- --target base \
|
|
|
|
|
- --file Dockerfile \
|
|
|
|
|
- ../..
|
|
|
|
|
-
|
|
|
|
|
- docker build --pull --tag ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
|
|
|
|
|
- --tag gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
|
|
|
|
|
- --cache-from gcr.io/overleaf-ops/$(PROJECT_NAME):$(BRANCH_NAME)-deps \
|
|
|
|
|
|
|
+ --tag ci/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
|
|
|
--tag us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
|
|
--tag us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME)-$(BUILD_NUMBER) \
|
|
|
- --cache-from us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME)-deps \
|
|
|
|
|
|
|
+ --tag us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME) \
|
|
|
|
|
+ --cache-from us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):$(BRANCH_NAME) \
|
|
|
|
|
+ --cache-from us-east1-docker.pkg.dev/overleaf-ops/ol-docker/$(PROJECT_NAME):main \
|
|
|
--file Dockerfile \
|
|
--file Dockerfile \
|
|
|
../..
|
|
../..
|
|
|
|
|
|
|
@@ -135,6 +129,7 @@ publish:
|
|
|
format format_fix \
|
|
format format_fix \
|
|
|
lint lint_fix \
|
|
lint lint_fix \
|
|
|
build_types typecheck \
|
|
build_types typecheck \
|
|
|
|
|
+ lint_ci format_ci typecheck_ci \
|
|
|
test test_clean test_unit test_unit_clean \
|
|
test test_clean test_unit test_unit_clean \
|
|
|
test_acceptance test_acceptance_debug test_acceptance_pre_run \
|
|
test_acceptance test_acceptance_debug test_acceptance_pre_run \
|
|
|
test_acceptance_run test_acceptance_run_debug test_acceptance_clean \
|
|
test_acceptance_run test_acceptance_run_debug test_acceptance_clean \
|