@@ -168,43 +168,50 @@ build-all: build-frontend build-backend build-operator build-runner build-state-
168168build-frontend : # # Build frontend image
169169 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Building frontend with $( CONTAINER_ENGINE) ..."
170170 @cd components/frontend && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) $(BUILD_FLAGS ) \
171+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
171172 -t $(FRONTEND_IMAGE ) .
172173 @echo " $( COLOR_GREEN) ✓$( COLOR_RESET) Frontend built: $( FRONTEND_IMAGE) "
173174
174175build-backend : # # Build backend image
175176 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Building backend with $( CONTAINER_ENGINE) ..."
176177 @cd components/backend && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) $(BUILD_FLAGS ) \
177178 --build-arg AMBIENT_VERSION=$(shell git describe --tags --always --dirty) \
179+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
178180 -t $(BACKEND_IMAGE ) .
179181 @echo " $( COLOR_GREEN) ✓$( COLOR_RESET) Backend built: $( BACKEND_IMAGE) "
180182
181183build-operator : # # Build operator image
182184 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Building operator with $( CONTAINER_ENGINE) ..."
183185 @cd components/operator && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) $(BUILD_FLAGS ) \
186+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
184187 -t $(OPERATOR_IMAGE ) .
185188 @echo " $( COLOR_GREEN) ✓$( COLOR_RESET) Operator built: $( OPERATOR_IMAGE) "
186189
187190build-runner : # # Build Claude Code runner image
188191 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Building runner with $( CONTAINER_ENGINE) ..."
189192 @cd components/runners/ambient-runner && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) $(BUILD_FLAGS ) \
193+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
190194 -t $(RUNNER_IMAGE ) .
191195 @echo " $( COLOR_GREEN) ✓$( COLOR_RESET) Runner built: $( RUNNER_IMAGE) "
192196
193197build-state-sync : # # Build state-sync image for S3 persistence
194198 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Building state-sync with $( CONTAINER_ENGINE) ..."
195199 @cd components/runners/state-sync && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) $(BUILD_FLAGS ) \
200+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
196201 -t $(STATE_SYNC_IMAGE ) .
197202 @echo " $( COLOR_GREEN) ✓$( COLOR_RESET) State-sync built: $( STATE_SYNC_IMAGE) "
198203
199204build-public-api : # # Build public API gateway image
200205 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Building public-api with $( CONTAINER_ENGINE) ..."
201206 @cd components/public-api && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) $(BUILD_FLAGS ) \
207+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
202208 -t $(PUBLIC_API_IMAGE ) .
203209 @echo " $( COLOR_GREEN) ✓$( COLOR_RESET) Public API built: $( PUBLIC_API_IMAGE) "
204210
205211build-api-server : # # Build ambient API server image
206212 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Building ambient-api-server with $( CONTAINER_ENGINE) ..."
207213 @cd components/ambient-api-server && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) $(BUILD_FLAGS ) \
214+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
208215 -t $(API_SERVER_IMAGE ) .
209216 @echo " $( COLOR_GREEN) ✓$( COLOR_RESET) API server built: $( API_SERVER_IMAGE) "
210217
@@ -347,7 +354,7 @@ local-status: check-kubectl ## Show status of local deployment
347354
348355local-reload-api-server : check-local-context # # Rebuild and reload ambient-api-server only
349356 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Rebuilding ambient-api-server..."
350- @$(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) -t $(API_SERVER_IMAGE ) components/ambient-api-server > /dev/null 2>&1
357+ @$(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) --build-arg GIT_COMMIT= $( shell git rev-parse HEAD) - t $(API_SERVER_IMAGE ) components/ambient-api-server > /dev/null 2>&1
351358 @$(CONTAINER_ENGINE ) tag $(API_SERVER_IMAGE ) localhost/$(API_SERVER_IMAGE ) 2> /dev/null || true
352359 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Loading image into kind cluster ($( KIND_CLUSTER_NAME) )..."
353360 @$(CONTAINER_ENGINE ) save localhost/$(API_SERVER_IMAGE ) | \
@@ -962,6 +969,7 @@ kind-reload-backend: check-kind check-kubectl check-local-context ## Rebuild and
962969 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Rebuilding backend..."
963970 @cd components/backend && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) \
964971 --build-arg AMBIENT_VERSION=$(shell git describe --tags --always --dirty) \
972+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
965973 -t $(BACKEND_IMAGE ) . $(QUIET_REDIRECT )
966974 @$(CONTAINER_ENGINE ) tag $(BACKEND_IMAGE ) localhost/$(BACKEND_IMAGE ) 2> /dev/null || true
967975 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Loading image into kind cluster ($( KIND_CLUSTER_NAME) )..."
@@ -976,6 +984,7 @@ kind-reload-backend: check-kind check-kubectl check-local-context ## Rebuild and
976984kind-reload-frontend : check-kind check-kubectl check-local-context # # Rebuild and reload frontend only (kind)
977985 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Rebuilding frontend..."
978986 @cd components/frontend && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) \
987+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
979988 -t $(FRONTEND_IMAGE ) . $(QUIET_REDIRECT )
980989 @$(CONTAINER_ENGINE ) tag $(FRONTEND_IMAGE ) localhost/$(FRONTEND_IMAGE ) 2> /dev/null || true
981990 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Loading image into kind cluster ($( KIND_CLUSTER_NAME) )..."
@@ -990,6 +999,7 @@ kind-reload-frontend: check-kind check-kubectl check-local-context ## Rebuild an
990999kind-reload-operator : check-kind check-kubectl check-local-context # # Rebuild and reload operator only (kind)
9911000 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Rebuilding operator..."
9921001 @cd components/operator && $(CONTAINER_ENGINE ) build $(PLATFORM_FLAG ) \
1002+ --build-arg GIT_COMMIT=$(shell git rev-parse HEAD) \
9931003 -t $(OPERATOR_IMAGE ) . $(QUIET_REDIRECT )
9941004 @$(CONTAINER_ENGINE ) tag $(OPERATOR_IMAGE ) localhost/$(OPERATOR_IMAGE ) 2> /dev/null || true
9951005 @echo " $( COLOR_BLUE) ▶$( COLOR_RESET) Loading image into kind cluster ($( KIND_CLUSTER_NAME) )..."
0 commit comments