2016-09-13 19:57:44 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Copyright 2016 The Kubernetes Authors All rights reserved.
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
2016-10-05 19:37:32 +00:00
|
|
|
# This script builds the minikube binary for all 3 platforms and uploads them.
|
|
|
|
# This is to done as part of the CI tests for Github PRs
|
|
|
|
|
2016-12-24 04:11:05 +00:00
|
|
|
# The script expects the following env variables:
|
2016-09-13 19:57:44 +00:00
|
|
|
# ghprbPullId: The pull request ID, injected from the ghpbr plugin.
|
|
|
|
# ghprbActualCommit: The commit hash, injected from the ghpbr plugin.
|
|
|
|
|
2018-10-19 23:00:06 +00:00
|
|
|
set -eux -o pipefail
|
2017-01-31 21:30:09 +00:00
|
|
|
|
2018-10-19 23:00:06 +00:00
|
|
|
declare -rx BUILD_IN_DOCKER=y
|
|
|
|
declare -rx GOPATH=/var/lib/jenkins/go
|
|
|
|
declare -rx ISO_BUCKET="minikube-builds/${ghprbPullId}"
|
|
|
|
declare -rx ISO_VERSION="testing"
|
|
|
|
declare -rx TAG="${ghprbActualCommit}"
|
|
|
|
|
|
|
|
readonly bucket="gs://minikube-builds"
|
2017-10-05 18:55:35 +00:00
|
|
|
|
|
|
|
docker kill $(docker ps -q) || true
|
2017-10-19 15:33:35 +00:00
|
|
|
docker rm $(docker ps -aq) || true
|
2018-10-19 23:00:06 +00:00
|
|
|
make -j 16 all && result=$? || result=$?
|
2017-10-24 17:17:14 +00:00
|
|
|
|
2018-10-19 23:00:06 +00:00
|
|
|
gsutil cp gs://minikube-builds/logs/index.html \
|
|
|
|
"gs://minikube-builds/logs/${ghprbPullId}/index.html"
|
2016-09-13 19:57:44 +00:00
|
|
|
|
2018-10-19 23:00:06 +00:00
|
|
|
if [[ "${result}" -ne 0 ]]; then
|
|
|
|
echo "build failed"
|
|
|
|
exit "${result}"
|
|
|
|
fi
|
2017-10-24 17:17:14 +00:00
|
|
|
|
2017-02-10 22:43:54 +00:00
|
|
|
|
2018-10-19 23:00:06 +00:00
|
|
|
git diff ${ghprbActualCommit} --name-only \
|
|
|
|
$(git merge-base origin/master ${ghprbActualCommit}) \
|
|
|
|
| grep -q deploy/iso/minikube && rebuild_iso=1 || rebuild_iso=0
|
|
|
|
|
|
|
|
if [[ "${rebuild_iso}" -eq 1 ]]; then
|
|
|
|
echo "ISO changes detected ... rebuilding ISO"
|
2017-02-10 22:43:54 +00:00
|
|
|
make release-iso
|
|
|
|
fi
|
|
|
|
|
2016-09-13 19:57:44 +00:00
|
|
|
cp -r test/integration/testdata out/
|
|
|
|
|
2017-02-10 22:43:54 +00:00
|
|
|
# Don't upload the buildroot artifacts if they exist
|
|
|
|
rm -r out/buildroot || true
|
|
|
|
|
2016-09-13 19:57:44 +00:00
|
|
|
gsutil -m cp -r out/* gs://minikube-builds/${ghprbPullId}/
|