Skip to content

Commit 38ad0bd

Browse files
committed
Ensure we only do dependency/collector generate during local dev
1 parent 6087b4e commit 38ad0bd

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

Makefile

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
## DOCKER_PLATFORM Overrides platform to build Docker images for (defaults to host platform).
8080
## GOEXPERIMENT Used to enable Go features behind feature flags.
8181
## SKIP_UI_BUILD Set to 1 to skip the UI build (assumes UI assets already exist).
82+
## SKIP_CODE_GENERATION Set to 1 to skip code generation before building the alloy binary
8283

8384
include tools/make/*.mk
8485

@@ -202,7 +203,7 @@ test-pyroscope:
202203
.PHONY: binaries alloy
203204
binaries: alloy
204205

205-
alloy: generate-ui
206+
alloy: generate-ui generate-source-code
206207
ifeq ($(USE_CONTAINER),1)
207208
$(RERUN_IN_CONTAINER)
208209
else
@@ -274,6 +275,18 @@ else
274275
cd ./tools/generate-module-dependencies && $(GO_ENV) go generate
275276
endif
276277

278+
generate-source-code:
279+
ifeq ($(USE_CONTAINER),1)
280+
$(RERUN_IN_CONTAINER)
281+
else ifeq ($(CI),true)
282+
@echo "Skipping code generation (CI=1)"
283+
else ifeq ($(SKIP_CODE_GENERATION),1)
284+
@echo "Skipping code generation (SKIP_CODE_GENERATION=1)"
285+
else
286+
@$(MAKE) generate-module-dependencies generate-otel-collector-distro
287+
endif
288+
289+
277290
generate-otel-collector-distro:
278291
ifeq ($(USE_CONTAINER),1)
279292
$(RERUN_IN_CONTAINER)

0 commit comments

Comments
 (0)