From 9be3c3fd765b4abe520aaa219d8e5a6ca60bb421 Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 5 Jan 2026 14:35:59 +0100 Subject: [PATCH] refactor: update Makefile to use conditional assignment (#30295) * refactor: update Makefile to use conditional assignment Co-authored-by: Jakob Ackermann GitOrigin-RevId: a00592608e3377701ec75617eef995ce4b05a95b --- services/web/Makefile | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/services/web/Makefile b/services/web/Makefile index 62db346a0f..57a6f19b1c 100644 --- a/services/web/Makefile +++ b/services/web/Makefile @@ -1,13 +1,19 @@ DOCKER_COMPOSE_FLAGS ?= -f docker-compose.yml BUILD_NUMBER ?= local -export BRANCH_NAME ?= $(shell git rev-parse --abbrev-ref HEAD) -BRANCH_NAME_TAG_SAFE = $(shell echo $(BRANCH_NAME) | sed 's/\//\-\-/') -export COMMIT_SHA ?= $(shell git rev-parse HEAD) +ifeq ($(BRANCH_NAME),) + export BRANCH_NAME := $(shell git rev-parse --abbrev-ref HEAD) +endif +BRANCH_NAME_TAG_SAFE := $(subst /,--,$(BRANCH_NAME)) +ifeq ($(COMMIT_SHA),) + export COMMIT_SHA := $(shell git rev-parse HEAD) +endif PROJECT_NAME = web -BUILD_DIR_NAME = $(shell pwd | xargs basename | tr -cd '[a-zA-Z0-9_.\-]') -PWD = $(shell pwd) -export MONOREPO ?= $(shell cd ../../ && pwd) +BUILD_DIR_NAME := web +PWD := $(shell pwd) +ifeq ($(MONOREPO),) + export MONOREPO := $(shell cd ../../ && pwd) +endif export OVERLEAF_CONFIG ?= /overleaf/services/web/test/acceptance/config/settings.test.saas.js export BASE_CONFIG ?= ${OVERLEAF_CONFIG}