Skip to content

Commit 5651730

Browse files
Merge pull request #11011 from sharifelgamal/prbot
minikube-pr-bot enhancements
2 parents 5a17d80 + 38caeb2 commit 5651730

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

hack/jenkins/installers/check_install_golang.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function install_golang() {
6262
# using sudo because previously installed versions might have been installed by a different user.
6363
# as it was the case on jenkins VM.
6464
sudo curl -qL -O "https://storage.googleapis.com/golang/go${1}.${INSTALLOS}-${ARCH}.tar.gz" &&
65-
sudo tar -xf go${1}.${INSTALLOS}-amd64.tar.gz &&
65+
sudo tar -xzf go${1}.${INSTALLOS}-amd64.tar.gz &&
6666
sudo rm -rf "${2}/go" &&
6767
sudo mv go "${2}/" && sudo chown -R $(whoami): ${2}/go
6868
popd >/dev/null

hack/jenkins/prbot.sh

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
#!/bin/bash
2+
3+
# Copyright 2021 The Kubernetes Authors All rights reserved.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -x -o pipefail
18+
# Only run this on PRs
19+
if [[ "${MINIKUBE_LOCATION}" == "master" ]]; then
20+
exit 0
21+
fi
22+
23+
# Make sure docker is installed and configured
24+
#./installers/check_install_docker.sh
25+
26+
# Make sure gh is installed and configured
27+
./installers/check_install_gh.sh
28+
29+
# Make sure go is installed and configured
30+
./installers/check_install_golang.sh "1.16" "/usr/local" || true
31+
32+
# Grab latest code
33+
git clone https://github.com/kubernetes/minikube.git
34+
cd minikube
35+
36+
# Build minikube binary and mkcmp binary
37+
make out/minikube out/mkcmp
38+
39+
# Make sure there aren't any old minikube clusters laying around
40+
out/minikube delete --all
41+
42+
# Run mkcmp
43+
out/mkcmp out/minikube pr://${MINIKUBE_LOCATION} | tee mkcmp.log
44+
if [ $? -gt 0 ]; then
45+
# Comment that mkcmp failed
46+
gh pr comment ${MINIKUBE_LOCATION} --body "timing minikube failed, please try again"
47+
exit 1
48+
fi
49+
output=$(cat mkcmp.log)
50+
gh pr comment ${MINIKUBE_LOCATION} --body "${output}"

0 commit comments

Comments
 (0)