-
-
Notifications
You must be signed in to change notification settings - Fork 139
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(buildDockerAndPublishImage.groovy): fix ath build #745
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
ae380a8
Add some debug
smerle33 7509345
more debug and bake print
smerle33 acf5a06
generate absolute path for IMAGE_DIR and IMAGE_DOCKERFILE used within…
smerle33 94e1563
remove debug
smerle33 522abe5
lint makefile
smerle33 02a2a5f
add windows debug
smerle33 ed02568
wip
smerle33 80e42aa
specific DockerFile path with absolute path only for linux/bake
smerle33 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,24 @@ | ||
# Detect Windows (only OS separating paths in $PATH with ";") to set specific variable and function to get compatible paths | ||
IMAGE_DIR ?= . | ||
ifeq '$(findstring ;,$(PATH))' ';' | ||
FixPath = $(subst /,\,$1) | ||
IMAGE_DIR ?= . | ||
else | ||
FixPath = $1 | ||
IMAGE_DIR ?= $(PWD) | ||
# need absolute path for docker bake | ||
IMAGE_DIR := $(abspath $(PWD)/$(IMAGE_DIR)) | ||
endif | ||
|
||
IMAGE_NAME ?= helloworld | ||
IMAGE_DEPLOY_NAME ?= "$(IMAGE_NAME)" | ||
BUILD_TARGETPLATFORM ?= linux/amd64 | ||
# Paths | ||
IMAGE_DOCKERFILE ?= "$(IMAGE_DIR)"/Dockerfile | ||
# need absolute path for docker bake | ||
ifeq ($(IMAGE_DOCKERFILE),) | ||
IMAGE_DOCKERFILE := $(abspath $(PWD)/Dockerfile) | ||
else | ||
IMAGE_DOCKERFILE := $(abspath $(PWD)/$(IMAGE_DOCKERFILE)) | ||
endif | ||
|
||
HADOLINT_REPORT ?= "$(IMAGE_DIR)"/hadolint.json | ||
TEST_HARNESS ?= "$(IMAGE_DIR)"/cst.yml | ||
DOCKER_BAKE_FILE ?= "$(IMAGE_DIR)"/docker-bake.hcl | ||
|
@@ -22,6 +29,16 @@ GIT_SCM_URL ?= $(shell git config --get remote.origin.url) | |
SCM_URI ?= $(subst [email protected]:,https://github.com/,"$(GIT_SCM_URL)") | ||
BUILD_DATE ?= $(shell date --utc '+%Y-%m-%dT%H:%M:%S' 2>/dev/null || gdate --utc '+%Y-%m-%dT%H:%M:%S') | ||
|
||
export IMAGE_DEPLOY_NAME \ | ||
TAG_NAME \ | ||
BAKE_TARGETPLATFORMS \ | ||
IMAGE_DOCKERFILE \ | ||
IMAGE_DIR \ | ||
GIT_COMMIT_REV \ | ||
GIT_SCM_URL \ | ||
BUILD_DATE \ | ||
SCM_URI | ||
|
||
help: ## Show this Makefile's help | ||
@echo "Help:" | ||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' | ||
|
@@ -54,8 +71,9 @@ build: ## Build the Docker Image $(IMAGE_NAME) from $(IMAGE_DOCKERFILE) | |
@echo "== Build succeeded" | ||
|
||
bake-build: ## Build the Docker Image(s) with dockerbake file | ||
@echo "== Building from DockerBake file" | ||
@docker buildx bake -f "$(call FixPath,$(DOCKER_BAKE_FILE))" | ||
@echo "== Building from DockerBake file $(DOCKER_BAKE_FILE)" | ||
@docker buildx bake -f "$(DOCKER_BAKE_FILE)" | ||
@echo "== Build succeeded" | ||
|
||
|
||
clean: ## Delete any file generated during the build steps | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: formatting