Skip to content

Commit 2d4661e

Browse files
authored
Makefile does not always use DOCKER_COMPOSE_ENV var (#1759)
Let say that you add a `/src/adservice/Dockerfile.elastic` to the project to build a specific version of the image. So you add the following line to the `.env.override` file: ```env AD_SERVICE_DOCKERFILE=./src/adservice/Dockerfile.elastic ``` If you run: ```sh make redeploy ``` The `/src/adservice/Dockerfile.elastic` should be used instead the default one. This commit adds `DOCKER_COMPOSE_ENV` variable anywhere it's needed. Closes #1758.
1 parent bafadb0 commit 2d4661e

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Makefile

+11-11
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ start-minimal:
149149

150150
.PHONY: stop
151151
stop:
152-
$(DOCKER_COMPOSE_CMD) down --remove-orphans --volumes
153-
$(DOCKER_COMPOSE_CMD) -f docker-compose-tests.yml down --remove-orphans --volumes
152+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) down --remove-orphans --volumes
153+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) -f docker-compose-tests.yml down --remove-orphans --volumes
154154
@echo ""
155155
@echo "OpenTelemetry Demo is stopped."
156156

@@ -164,10 +164,10 @@ ifdef SERVICE
164164
endif
165165

166166
ifdef service
167-
$(DOCKER_COMPOSE_CMD) stop $(service)
168-
$(DOCKER_COMPOSE_CMD) rm --force $(service)
169-
$(DOCKER_COMPOSE_CMD) create $(service)
170-
$(DOCKER_COMPOSE_CMD) start $(service)
167+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) stop $(service)
168+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) rm --force $(service)
169+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) create $(service)
170+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) start $(service)
171171
else
172172
@echo "Please provide a service name using `service=[service name]` or `SERVICE=[service name]`"
173173
endif
@@ -182,11 +182,11 @@ ifdef SERVICE
182182
endif
183183

184184
ifdef service
185-
$(DOCKER_COMPOSE_CMD) build $(service)
186-
$(DOCKER_COMPOSE_CMD) stop $(service)
187-
$(DOCKER_COMPOSE_CMD) rm --force $(service)
188-
$(DOCKER_COMPOSE_CMD) create $(service)
189-
$(DOCKER_COMPOSE_CMD) start $(service)
185+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) build $(service)
186+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) stop $(service)
187+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) rm --force $(service)
188+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) create $(service)
189+
$(DOCKER_COMPOSE_CMD) $(DOCKER_COMPOSE_ENV) start $(service)
190190
else
191191
@echo "Please provide a service name using `service=[service name]` or `SERVICE=[service name]`"
192192
endif

0 commit comments

Comments
 (0)