Skip to content

Commit

Permalink
debug makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
fqjony committed Dec 23, 2024
1 parent afaaf5e commit dca5ff2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ jobs:
uses: docker/setup-buildx-action@v3

- name: Run Development Pipeline
# run: make dev-pipeline
run: MULTIPLATFORM=true make dev-pipeline
run: make dev-pipeline
# run: MULTIPLATFORM=true make dev-pipeline
working-directory: .
env:
AZURE_CREDS: ${{ secrets.AZURE_CREDS }}
Expand Down
19 changes: 13 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,21 @@ build:
# Run Docker container (supports interactive mode)
run: clean
@echo "Running Docker container..."
@echo "Docker image: $(DOCKER_IMAGE)"
@echo "Docker command: $(COMMAND)"
@docker run $(if $(INTERACTIVE),-it,-d) --rm --name $(CONTAINER_NAME) \
$(foreach file,$(wildcard *.json),\
$(eval CREDS_VAR_NAME=$(shell echo "$(file)" | sed -e 's/\.json//g' -e 's/\./_/g' | tr '[:lower:]' '[:upper:]')) \
$(eval CREDS_VAR_VALUE=$(shell cat "$(file)" | jq -c .)) \
-e $(CREDS_VAR_NAME)='$(CREDS_VAR_VALUE)' \
$(if $(wildcard *.json),\
$(foreach file,$(wildcard *.json),\
$(eval CREDS_VAR_NAME := $(shell echo "$(file)" | sed -e 's/\.json//g' -e 's/\./_/g' | tr '[:lower:]' '[:upper:]')) \
$(eval CREDS_VAR_VALUE := $(shell cat "$(file)" | jq -c .)) \
-e $(CREDS_VAR_NAME)='$(CREDS_VAR_VALUE)' \
)\
) \
$(foreach env_var,$(filter %_CREDS,$(.VARIABLES)),\
-e $(env_var)=$($(env_var)) \
$(if $(filter %_CREDS,$(.VARIABLES)),\
$(eval CREDS_ENV := $(foreach env_var,$(filter %_CREDS,$(.VARIABLES)),\
-e $(env_var)=$($(env_var)) \
)) \
$(CREDS_ENV) \
) \
$(foreach vol,$(VOLUMES),-v $(vol)) \
$(DOCKER_IMAGE) $(COMMAND)
Expand Down

0 comments on commit dca5ff2

Please sign in to comment.