Skip to content

Commit

Permalink
Push REPO_VERSION var into containers for builds
Browse files Browse the repository at this point in the history
Set `REPO_VERSION` via Podman and Docker container run commands
to properly have any externally set value (e.g., GitHub Actions)
inherited by the container build environment.

See also:

- atc0005/shared-project-resources#208
  • Loading branch information
atc0005 committed Jul 31, 2024
1 parent 5aa2154 commit 2bd7b14
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,7 @@ docker-release-build: clean helper-builder-setup
@echo
@echo "Using release builder image to generate project release assets"
$(CONTAINER_COMMAND) container run \
--env REPO_VERSION=$(REPO_VERSION) \
--user builduser:builduser \
--rm \
-i \
Expand All @@ -827,6 +828,7 @@ podman-release-build: clean helper-builder-setup
@echo
@echo "Using release builder image to generate project release assets"
$(CONTAINER_COMMAND) container run \
--env REPO_VERSION=$(REPO_VERSION) \
--rm \
-i \
-v $$PWD/$(OUTPUTDIR):/builds/$(OUTPUTDIR):rw \
Expand All @@ -846,6 +848,7 @@ docker-dev-build: clean helper-builder-setup
@echo
@echo "Using release builder image to generate project release assets"
$(CONTAINER_COMMAND) container run \
--env REPO_VERSION=$(REPO_VERSION) \
--user builduser:builduser \
--rm \
-i \
Expand All @@ -866,6 +869,7 @@ podman-dev-build: clean helper-builder-setup
@echo
@echo "Using release builder image to generate project release assets"
$(CONTAINER_COMMAND) container run \
--env REPO_VERSION=$(REPO_VERSION) \
--rm \
-i \
-v $$PWD/$(OUTPUTDIR):/builds/$(OUTPUTDIR):rw \
Expand All @@ -887,6 +891,7 @@ docker-packages: helper-builder-setup

@echo "Building with $(CONTAINER_COMMAND)"
$(CONTAINER_COMMAND) container run \
--env REPO_VERSION=$(REPO_VERSION) \
--rm \
--user builduser:builduser \
-i \
Expand All @@ -909,6 +914,7 @@ podman-packages: helper-builder-setup

@echo "Building with $(CONTAINER_COMMAND)"
$(CONTAINER_COMMAND) container run \
--env REPO_VERSION=$(REPO_VERSION) \
--rm \
-i \
-v $$PWD/$(OUTPUTDIR):/builds/$(OUTPUTDIR):rw \
Expand Down

0 comments on commit 2bd7b14

Please sign in to comment.