|
| 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