Skip to content

Commit

Permalink
Added no cache build
Browse files Browse the repository at this point in the history
  • Loading branch information
francis-nijay committed Sep 6, 2024
1 parent c5048a3 commit 6785cd1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ podman-push: download-csm-common go-build
$(eval include csm-common.mk)
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --push

podman-build-no-cache: download-csm-common go-build
$(eval include csm-common.mk)
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --no-cache

podman-no-cachepush: download-csm-common go-build
$(eval include csm-common.mk)
sh build.sh --baseubi $(DEFAULT_BASEIMAGE) --goimage $(DEFAULT_GOIMAGE) --push --no-cache

#
# Docker-related tasks
#
Expand Down
7 changes: 6 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function build_image {
echo ${DEFAULT_GOIMAGE}
bash build_ubi_micro.sh ${BASE_UBI_IMAGE}
echo $BUILDCMD build -t ${IMAGE_NAME}:${IMAGE_TAG} .
(cd .. && $BUILDCMD build -t ${IMAGE_NAME}:${IMAGE_TAG} --build-arg GOIMAGE=$DEFAULT_GOIMAGE --build-arg GOPROXY=$GOPROXY -f csi-unity/Dockerfile.podman . --format=docker)
(cd .. && $BUILDCMD build ${NOCACHE} -t ${IMAGE_NAME}:${IMAGE_TAG} --build-arg GOIMAGE=$DEFAULT_GOIMAGE --build-arg GOPROXY=$GOPROXY -f csi-unity/Dockerfile.podman . --format=docker)
echo $BUILDCMD tag ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_REPO}/${IMAGE_REPO_NAMESPACE}/${IMAGE_NAME}:${IMAGE_TAG}
$BUILDCMD tag ${IMAGE_NAME}:${IMAGE_TAG} ${IMAGE_REPO}/${IMAGE_REPO_NAMESPACE}/${IMAGE_NAME}:${IMAGE_TAG}
}
Expand All @@ -51,6 +51,7 @@ BIN_NAME=${NAME}
IMAGE_REPO=dellemc
IMAGE_REPO_NAMESPACE=csi-unity
IMAGE_TAG=${IMAGE_TAG:-$(date +%Y%m%d%H%M%S)}
NOCACHE=

# Read options
for param in $*; do
Expand All @@ -69,6 +70,10 @@ for param in $*; do
shift
PUSH_IMAGE='true'
;;
"--no-cache")
shift
NOCACHE='--no-cache'
;;
esac
done

Expand Down

0 comments on commit 6785cd1

Please sign in to comment.