Skip to content

Commit 24976cf

Browse files
committed
rebuild iso and kicbase on release
1 parent 2b7bf37 commit 24976cf

File tree

2 files changed

+21
-48
lines changed

2 files changed

+21
-48
lines changed

hack/jenkins/build_iso.sh

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -47,27 +47,16 @@ else
4747
export ISO_BUCKET
4848
fi
4949

50-
if [ "$release" = false ]; then
51-
# Build a new ISO for the PR
52-
make release-iso | tee iso-logs.txt
53-
# Abort with error message if above command failed
54-
ec=$?
55-
if [ $ec -gt 0 ]; then
56-
if [ "$release" = false ]; then
57-
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed.
58-
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt
59-
"
60-
fi
61-
exit $ec
50+
make release-iso | tee iso-logs.txt
51+
# Abort with error message if above command failed
52+
ec=$?
53+
if [ $ec -gt 0 ]; then
54+
if [ "$release" = false ]; then
55+
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new ISO failed.
56+
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/iso_build.txt
57+
"
6258
fi
63-
else
64-
# Copy the most recently built PR ISO for release
65-
CURRENT_ISO_VERSION=$(egrep "ISO_VERSION \?=" Makefile | cut -d " " -f 3)
66-
CURRENT_ISO_BUCKET=$(egrep "isoBucket :=" pkg/minikube/download/iso.go | cut -d " " -f 3 | cut -d '"' -f 2)
67-
gsutil cp gs://${CURRENT_ISO_BUCKET}/minikube-${CURRENT_ISO_VERSION}-amd64.iso gs://${ISO_BUCKET}/minikube-${ISO_VERSION}-amd64.iso
68-
gsutil cp gs://${CURRENT_ISO_BUCKET}/minikube-${CURRENT_ISO_VERSION}-amd64.iso.sha256 gs://${ISO_BUCKET}/minikube-${ISO_VERSION}-amd64.iso.sha256
69-
gsutil cp gs://${CURRENT_ISO_BUCKET}/minikube-${CURRENT_ISO_VERSION}-arm64.iso gs://${ISO_BUCKET}/minikube-${ISO_VERSION}-arm64.iso
70-
gsutil cp gs://${CURRENT_ISO_BUCKET}/minikube-${CURRENT_ISO_VERSION}-arm64.iso.sha256 gs://${ISO_BUCKET}/minikube-${ISO_VERSION}-arm64.iso.sha256
59+
exit $ec
7160
fi
7261

7362
git config user.name "minikube-bot"

hack/jenkins/kicbase_auto_build.sh

Lines changed: 12 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ curl -L https://github.com/kubernetes/minikube/raw/master/pkg/drivers/kic/types.
3737
# kicbase tags are of the form VERSION-TIMESTAMP-PR, so this grep finds that TIMESTAMP in the middle
3838
# if it doesn't exist, it will just return VERSION, which is covered in the if statement below
3939
HEAD_KIC_TIMESTAMP=$(egrep "Version =" types-head.go | cut -d \" -f 2 | cut -d "-" -f 2)
40-
CURRENT_KIC_VERSION=$(egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f 2)
41-
CURRENT_KIC_TS=$(echo $CURRENT_KIC_VERSION | cut -d "-" -f 2)
40+
CURRENT_KIC_TS=$(egrep "Version =" pkg/drivers/kic/types.go | cut -d \" -f 2 | cut -d "-" -f 2)
4241
if [[ $HEAD_KIC_TIMESTAMP != v* ]]; then
4342
diff=$((CURRENT_KIC_TS-HEAD_KIC_TIMESTAMP))
4443
if [[ $CURRENT_KIC_TS == v* ]] || [ $diff -lt 0 ]; then
@@ -68,33 +67,18 @@ GCR_IMG=${GCR_REPO}:${KIC_VERSION}
6867
DH_IMG=${DH_REPO}:${KIC_VERSION}
6968
export KICBASE_IMAGE_REGISTRIES="${GCR_IMG} ${DH_IMG}"
7069

71-
if [ "$release" = false ]; then
72-
# Build a new kicbase image
73-
CIBUILD=yes make push-kic-base-image | tee kic-logs.txt
74-
75-
# Abort with error message if above command failed
76-
ec=$?
77-
if [ $ec -gt 0 ]; then
78-
if [ "$release" = false ]; then
79-
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new kicbase image failed.
80-
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/kic_image_build.txt
81-
"
82-
fi
83-
exit $ec
84-
fi
85-
else
86-
# Install crane, it does exactly what we want it to do
87-
go install github.com/google/go-containerregistry/cmd/crane@latest
88-
89-
CURRENT_GCR_REPO=$(grep "gcrRepo =" pkg/drivers/kic/types.go | cut -d \" -f 2)
90-
CURRENT_DH_REPO=$(grep "dockerhubRepo =" pkg/drivers/kic/types.go | cut -d \" -f 2)
91-
92-
CURRENT_GCR_IMG=$CURRENT_GCR_REPO:$CURRENT_KIC_VERSION
93-
CURRENT_DH_IMG=$CURRENT_DH_REPO:$CURRENT_KIC_VERSION
94-
95-
crane copy $CURRENT_GCR_IMG $GCR_IMG
96-
crane copy $CURRENT_DH_IMG $DH_IMG
70+
# Build a new kicbase image
71+
CIBUILD=yes make push-kic-base-image | tee kic-logs.txt
9772

73+
# Abort with error message if above command failed
74+
ec=$?
75+
if [ $ec -gt 0 ]; then
76+
if [ "$release" = false ]; then
77+
gh pr comment ${ghprbPullId} --body "Hi ${ghprbPullAuthorLoginMention}, building a new kicbase image failed.
78+
See the logs at: https://storage.cloud.google.com/minikube-builds/logs/${ghprbPullId}/${ghprbActualCommit::7}/kic_image_build.txt
79+
"
80+
fi
81+
exit $ec
9882
fi
9983

10084
# Retrieve the sha from the new image

0 commit comments

Comments
 (0)