Skip to content

Commit c76d8c6

Browse files
committed
fix(buca): align Makefile.docker to maintainer canonical (check-go-mod + clean vendor); fix subdir Makefile include paths (monorepo-relative → standalone-relative); add no-op apply to cmd/run-task/Makefile
1 parent 64ad8e3 commit c76d8c6

3 files changed

Lines changed: 24 additions & 6 deletions

File tree

Makefile.docker

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,39 @@
11
DIRS += $(shell find */* -maxdepth 0 -name Makefile -exec dirname "{}" \;)
22

33
.PHONY: build
4-
build:
4+
build: check-go-mod
55
DOCKER_BUILDKIT=1 \
66
docker build \
7+
--pull \
8+
--no-cache \
79
--rm=true \
810
--platform=linux/amd64 \
911
--build-arg DOCKER_REGISTRY=$(DOCKER_REGISTRY) \
1012
--build-arg BRANCH=$(BRANCH) \
11-
--build-arg BUILD_GIT_VERSION=$$(git describe --tags --always --dirty) \
1213
--build-arg BUILD_GIT_COMMIT=$$(git rev-parse --short HEAD) \
1314
--build-arg BUILD_DATE=$$(date -u +%Y-%m-%dT%H:%M:%SZ) \
1415
-t $(DOCKER_REGISTRY)/$(SERVICE):$(BRANCH) \
1516
-f Dockerfile .
1617

18+
.PHONY: check-go-mod
19+
check-go-mod:
20+
@if [ -f "go.mod" ]; then \
21+
echo "go.mod found, running go mod vendor..."; \
22+
go mod vendor; \
23+
else \
24+
echo "go.mod not found, skipping go mod vendor."; \
25+
fi
26+
1727
.PHONY: upload
1828
upload:
1929
docker push $(DOCKER_REGISTRY)/$(SERVICE):$(BRANCH)
2030

2131
.PHONY: clean
2232
clean:
2333
docker rmi $(DOCKER_REGISTRY)/$(SERVICE):$(BRANCH) || true
24-
docker builder prune --max-used-space 21474836480 -f || true
34+
docker image prune -f || true
35+
docker builder prune --all -f || true
36+
rm -rf vendor
2537

2638
.PHONY: apply
2739
apply:

cmd/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
include ../../../Makefile.folder
1+
include ../Makefile.folder

cmd/run-task/Makefile

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
include ../../../../Makefile.variables
2-
include ../../../../common.env
1+
include ../../Makefile.variables
2+
include ../../common.env
33

44
TASK_FILE ?= dummy-task.md
55
BRANCH := dev
@@ -8,6 +8,12 @@ AGENT_DIR ?= $(shell cd ../.. && pwd)/agent
88
MODEL ?= sonnet
99
ALLOWED_TOOLS ?= Grep,Read
1010

11+
# No-op so the recursive `apply` sweep from the parent Makefile.docker doesn't
12+
# choke on this directory.
13+
.PHONY: apply
14+
apply:
15+
@echo "skip apply for cmd/run-task (local CLI, not deployed)"
16+
1117
generate-dummy-task:
1218
@echo '---' > $(TASK_FILE)
1319
@echo 'status: in_progress' >> $(TASK_FILE)

0 commit comments

Comments
 (0)