Skip to content
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

Added no cache buildAdded make target to build without cache #229

Merged
merged 4 commits into from
Sep 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To reach --no-cache in the build script it may require some changes, Please check the same.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


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
9 changes: 7 additions & 2 deletions build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ function build_image {
echo ${BASE_UBI_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)
echo $BUILDCMD build ${NOCACHE} -t ${IMAGE_NAME}:${IMAGE_TAG} .
(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