Skip to content

Commit

Permalink
specific DockerFile path with absolute path only for linux/bake
Browse files Browse the repository at this point in the history
  • Loading branch information
smerle33 committed Sep 8, 2023
1 parent ed02568 commit 80e42aa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
14 changes: 9 additions & 5 deletions resources/io/jenkins/infra/docker/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,17 @@ IMAGE_NAME ?= helloworld
IMAGE_DEPLOY_NAME ?= "$(IMAGE_NAME)"
BUILD_TARGETPLATFORM ?= linux/amd64
# Paths
# need absolute path for docker bake
ifeq ($(IMAGE_DOCKERFILE),)
IMAGE_DOCKERFILE := $(abspath $(PWD)/Dockerfile)
# Detect Windows (only OS separating paths in $PATH with ";") to set specific absolute paths for linux (bake) only
ifeq '$(findstring ;,$(PATH))' ';'
IMAGE_DOCKERFILE ?= "$(IMAGE_DIR)"/Dockerfile
else
IMAGE_DOCKERFILE := $(abspath $(PWD)/$(IMAGE_DOCKERFILE))
# need absolute path for docker bake
ifeq ($(IMAGE_DOCKERFILE),)
IMAGE_DOCKERFILE := $(abspath $(PWD)/Dockerfile)
else
IMAGE_DOCKERFILE := $(abspath $(PWD)/$(IMAGE_DOCKERFILE))
endif
endif

HADOLINT_REPORT ?= "$(IMAGE_DIR)"/hadolint.json
TEST_HARNESS ?= "$(IMAGE_DIR)"/cst.yml
DOCKER_BAKE_FILE ?= "$(IMAGE_DIR)"/docker-bake.hcl
Expand Down
2 changes: 0 additions & 2 deletions vars/buildDockerAndPublishImage.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -187,8 +187,6 @@ def call(String imageShortName, Map userConfig=[:]) {
if (isUnix()) {
sh 'make lint'
} else {
powershell "$pwd"
powershell 'dir c:\\maven\\jdk11'
powershell 'make lint'
}
} finally {
Expand Down

0 comments on commit 80e42aa

Please sign in to comment.