2016-10-05 19:37:32 +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-12 22:31:01 +00:00
|
|
|
# This script builds all the minikube binary for all 3 platforms as well as Windows-installer and .deb
|
|
|
|
# This is intended to be run on a new release tag in order to build/upload the required files for a release
|
2016-10-05 19:37:32 +00:00
|
|
|
|
2016-12-24 04:11:05 +00:00
|
|
|
# The script expects the following env variables:
|
2016-12-23 11:46:04 +00:00
|
|
|
# VERSION_MAJOR: The major version of the tag to be released.
|
|
|
|
# VERSION_MINOR: The minor version of the tag to be released.
|
|
|
|
# VERSION_BUILD: The build version of the tag to be released.
|
2016-10-12 22:31:01 +00:00
|
|
|
# BUCKET: The GCP bucket the build files should be uploaded to.
|
2016-12-23 11:46:04 +00:00
|
|
|
# GITHUB_TOKEN: The Github API access token. Injected by the Jenkins credential provider.
|
2016-10-05 19:37:32 +00:00
|
|
|
|
2016-10-12 22:31:01 +00:00
|
|
|
set -e
|
|
|
|
|
2016-10-05 19:37:32 +00:00
|
|
|
export TAGNAME=v${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}
|
2019-02-24 19:03:57 +00:00
|
|
|
export DEB_VERSION=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}
|
2019-02-24 19:50:30 +00:00
|
|
|
export RPM_VERSION=${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}
|
2017-07-26 00:03:43 +00:00
|
|
|
export GOPATH=~/go
|
2016-10-05 19:37:32 +00:00
|
|
|
|
2016-10-12 22:31:01 +00:00
|
|
|
# Make sure the tag matches the Makefile
|
|
|
|
cat Makefile | grep "VERSION_MAJOR ?=" | grep $VERSION_MAJOR
|
|
|
|
cat Makefile | grep "VERSION_MINOR ?=" | grep $VERSION_MINOR
|
|
|
|
cat Makefile | grep "VERSION_BUILD ?=" | grep $VERSION_BUILD
|
2016-10-05 19:37:32 +00:00
|
|
|
|
2016-10-12 22:31:01 +00:00
|
|
|
# Build and upload
|
2019-02-24 19:50:30 +00:00
|
|
|
BUILD_IN_DOCKER=y make -j 16 all out/minikube-installer.exe out/minikube_${DEB_VERSION}.deb out/minikube-${RPM_VERSION}.rpm
|
2017-11-30 17:32:35 +00:00
|
|
|
make checksum
|
|
|
|
|
2017-10-27 00:01:57 +00:00
|
|
|
gsutil -m cp out/* gs://$BUCKET/releases/$TAGNAME/
|
2016-10-05 19:37:32 +00:00
|
|
|
|
2016-10-12 22:31:01 +00:00
|
|
|
# Bump latest
|
|
|
|
gsutil cp -r gs://$BUCKET/releases/$TAGNAME/* gs://$BUCKET/releases/latest/
|