rebuild iso and kicbase on release

pull/15716/head
Steven Powell 2023-01-26 15:25:58 -08:00
parent 2b7bf372b8
commit 24976cf6f9
2 changed files with 20 additions and 47 deletions

View File

@ -47,27 +47,16 @@ else
export ISO_BUCKET
fi
if [ "$release" = false ]; then
# Build a new ISO for the PR
make release-iso | tee iso-logs.txt
# Abort with error message if above command failed
ec=$?
if [ $ec -gt 0 ]; then
if [ "$release" = false ]; then
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed.
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt
"
fi
exit $ec
make release-iso | tee iso-logs.txt
# Abort with error message if above command failed
ec=$?
if [ $ec -gt 0 ]; then
if [ "$release" = false ]; then
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed.
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt
"
fi
else
# Copy the most recently built PR ISO for release
CURRENT_ISO_VERSION=$(egrep "ISO_VERSION \?=" Makefile | cut -d " " -f 3)
CURRENT_ISO_BUCKET=$(egrep "isoBucket :=" pkg/minikube/download/iso.go | cut -d " " -f 3 | cut -d '"' -f 2)
gsutil cp gs://${CURRENT_ISO_BUCKET}/minikube-${CURRENT_ISO_VERSION}-amd64.iso gs://${ISO_BUCKET}/minikube-${ISO_VERSION}-amd64.iso
gsutil cp gs://${CURRENT_ISO_BUCKET}/minikube-${CURRENT_ISO_VERSION}-amd64.iso.sha256 gs://${ISO_BUCKET}/minikube-${ISO_VERSION}-amd64.iso.sha256
gsutil cp gs://${CURRENT_ISO_BUCKET}/minikube-${CURRENT_ISO_VERSION}-arm64.iso gs://${ISO_BUCKET}/minikube-${ISO_VERSION}-arm64.iso
gsutil cp gs://${CURRENT_ISO_BUCKET}/minikube-${CURRENT_ISO_VERSION}-arm64.iso.sha256 gs://${ISO_BUCKET}/minikube-${ISO_VERSION}-arm64.iso.sha256
exit $ec
fi
git config user.name "minikube-bot"

View File

@ -37,8 +37,7 @@ curl -L https://github.com/kubernetes/minikube/raw/master/pkg/drivers/kic/types.
# kicbase tags are of the form VERSION-TIMESTAMP-PR, so this grep finds that TIMESTAMP in the middle
# if it doesn't exist, it will just return VERSION, which is covered in the if statement below
HEAD_KIC_TIMESTAMP=$(egrep "Version =" types-head.go | cut -d \" -f 2 | cut -d "-" -f 2)
CURRENT_KIC_VERSION=$(egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f 2)
CURRENT_KIC_TS=$(echo $CURRENT_KIC_VERSION | cut -d "-" -f 2)
CURRENT_KIC_TS=$(egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f 2 | cut -d "-" -f 2)
if [[ $HEAD_KIC_TIMESTAMP != v* ]]; then
diff=$((CURRENT_KIC_TS-HEAD_KIC_TIMESTAMP))
if [[ $CURRENT_KIC_TS == v* ]] || [ $diff -lt 0 ]; then
@ -68,33 +67,18 @@ GCR_IMG=${GCR_REPO}:${KIC_VERSION}
DH_IMG=${DH_REPO}:${KIC_VERSION}
export KICBASE_IMAGE_REGISTRIES="${GCR_IMG} ${DH_IMG}"
if [ "$release" = false ]; then
# Build a new kicbase image
CIBUILD=yes make push-kic-base-image | tee kic-logs.txt
# Build a new kicbase image
CIBUILD=yes make push-kic-base-image | tee kic-logs.txt
# Abort with error message if above command failed
ec=$?
if [ $ec -gt 0 ]; then
if [ "$release" = false ]; then
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new kicbase image failed.
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/kic_image_build.txt
"
fi
exit $ec
# Abort with error message if above command failed
ec=$?
if [ $ec -gt 0 ]; then
if [ "$release" = false ]; then
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new kicbase image failed.
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/kic_image_build.txt
"
fi
else
# Install crane, it does exactly what we want it to do
go install github.com/google/go-containerregistry/cmd/crane@latest
CURRENT_GCR_REPO=$(grep "gcrRepo =" pkg/drivers/kic/types.go | cut -d \" -f 2)
CURRENT_DH_REPO=$(grep "dockerhubRepo =" pkg/drivers/kic/types.go | cut -d \" -f 2)
CURRENT_GCR_IMG=$CURRENT_GCR_REPO:$CURRENT_KIC_VERSION
CURRENT_DH_IMG=$CURRENT_DH_REPO:$CURRENT_KIC_VERSION
crane copy $CURRENT_GCR_IMG $GCR_IMG
crane copy $CURRENT_DH_IMG $DH_IMG
exit $ec
fi
# Retrieve the sha from the new image