Skip to content

Commit 7940e39

Browse files
authored
feat(make): add configurable LOCAL_BUILD_TARGET for run-local (#2190)
Allow overriding the build target used by run-local via the LOCAL_BUILD_TARGET variable (defaults to build-debug). Can be set in the env file or as an environment variable: export LOCAL_BUILD_TARGET=build
1 parent e72e2f5 commit 7940e39

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

packages/api/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
ENV := $(shell cat ../../.last_used_env || echo "not-set")
22
-include ../../.env.${ENV}
3+
4+
LOCAL_BUILD_TARGET ?= build-debug
35
PREFIX := $(strip $(subst ",,$(PREFIX)))
46
HOSTNAME := $(shell hostname 2> /dev/null || hostnamectl hostname 2> /dev/null)
57
$(if $(HOSTNAME),,$(error Failed to determine hostname: both 'hostname' and 'hostnamectl' failed))
@@ -54,8 +56,7 @@ define setup_local_env
5456
endef
5557

5658
.PHONY: run-local
57-
run-local:
58-
make build-debug
59+
run-local: $(LOCAL_BUILD_TARGET)
5960
$(call setup_local_env)
6061
NODE_ID=$(HOSTNAME) ./bin/api --port 3000
6162

packages/client-proxy/Makefile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
ENV := $(shell cat ../../.last_used_env || echo "not-set")
22
-include ../../.env.${ENV}
3+
4+
LOCAL_BUILD_TARGET ?= build-debug
35
PREFIX := $(strip $(subst ",,$(PREFIX)))
46
HOSTNAME := $(shell hostname 2> /dev/null || hostnamectl hostname 2> /dev/null)
57
$(if $(HOSTNAME),,$(error Failed to determine hostname: both 'hostname' and 'hostnamectl' failed))
@@ -39,8 +41,7 @@ define setup_local_env
3941
endef
4042

4143
.PHONY: run-local
42-
run-local:
43-
make build-debug
44+
run-local: $(LOCAL_BUILD_TARGET)
4445
$(call setup_local_env)
4546
NODE_ID=$(HOSTNAME) ./bin/client-proxy
4647

0 commit comments

Comments
 (0)