From c053b9a51ba0e4086bdf7fffa7f258ae1c2f3d13 Mon Sep 17 00:00:00 2001 From: Mike Danese Date: Fri, 26 Jun 2015 14:42:48 -0700 Subject: [PATCH] add documentation and script on how to get recent and "nightly" builds --- docs/devel/README.md | 2 ++ docs/devel/getting-builds.md | 24 +++++++++++++ hack/get-build.sh | 70 ++++++++++++++++++++++++++++++++++++ 3 files changed, 96 insertions(+) create mode 100644 docs/devel/getting-builds.md create mode 100755 hack/get-build.sh diff --git a/docs/devel/README.md b/docs/devel/README.md index dc2909ffd39..5957902f03d 100644 --- a/docs/devel/README.md +++ b/docs/devel/README.md @@ -31,4 +31,6 @@ Docs in this directory relate to developing Kubernetes. * **Faster PR reviews** ([faster_reviews.md](faster_reviews.md)): How to get faster PR reviews. +* **Getting Recent Builds** ([getting-builds.md](getting-builds.md)): How to get recent builds including the latest builds to pass CI. + [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/README.md?pixel)]() diff --git a/docs/devel/getting-builds.md b/docs/devel/getting-builds.md new file mode 100644 index 00000000000..dbad8f3aa8a --- /dev/null +++ b/docs/devel/getting-builds.md @@ -0,0 +1,24 @@ +# Getting Kubernetes Builds + +You can use [hack/get-build.sh](../../hack/get-build.sh) to or use as a reference on how to get the most recent builds with curl. With `get-build.sh` you can grab the most recent stable build, the most recent release candidate, or the most recent build to pass our ci and gce e2e tests (essentially a nightly build). + +``` +usage: + ./hack/get-build.sh [stable|release|latest|latest-green] + + stable: latest stable version + release: latest release candidate + latest: latest ci build + latest-green: latest ci build to pass gce e2e +``` + +You can also use the gsutil tool to explore the Google Cloud Storage release bucket. Here are some examples: +``` +gsutil cat gs://kubernetes-release/ci/latest.txt # output the latest ci version number +gsutil cat gs://kubernetes-release/ci/latest-green.txt # output the latest ci version number that passed gce e2e +gsutil ls gs://kubernetes-release/ci/v0.20.0-29-g29a55cc/ # list the contents of a ci release +gsutil ls gs://kubernetes-release/release # list all official releases and rcs +``` + + +[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/devel/getting-builds.md?pixel)]() diff --git a/hack/get-build.sh b/hack/get-build.sh new file mode 100755 index 00000000000..22e802ba83b --- /dev/null +++ b/hack/get-build.sh @@ -0,0 +1,70 @@ +#!/bin/bash + +# Copyright 2015 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. + +set -o errexit +set -o nounset +set -o pipefail + +declare -r KUBE_RELEASE_BUCKET_URL="https://storage.googleapis.com/kubernetes-release" +declare -r KUBE_TAR_NAME="kubernetes.tar.gz" + +usage() { + echo "usage: + $0 [stable|release|latest|latest-green] + + stable: latest stable version + release: latest release candidate + latest: latest ci build + latest-green: latest ci build to pass gce e2e" +} + +if [[ $# -ne 1 ]]; then + usage + exit 1 +fi + +case "$1" in + "latest") + # latest ci version is written in the latest.txt in the /ci dir + KUBE_TAR_RELATIVE_PATH="ci" + KUBE_VERSION_FILE="latest.txt" + ;; + "latest-green") + # latest ci version to pass gce e2e is written in the latest-green.txt in the /ci dir + KUBE_TAR_RELATIVE_PATH="ci" + KUBE_VERSION_FILE="latest-green.txt" + ;; + "stable") + # latest stable release version is written in the stable.txt file in the /release dir + KUBE_TAR_RELATIVE_PATH="release" + KUBE_VERSION_FILE="stable.txt" + ;; + "release") + # latest release candidate version is written in latest.txt in the /release dir + KUBE_TAR_RELATIVE_PATH="release" + KUBE_VERSION_FILE="latest.txt" + ;; + *) + usage + exit 1 + ;; +esac + +KUBE_BINARY_DIRECTORY="${KUBE_RELEASE_BUCKET_URL}/${KUBE_TAR_RELATIVE_PATH}" +KUBE_VERSION=$(curl --silent --fail "${KUBE_BINARY_DIRECTORY}/${KUBE_VERSION_FILE}") +KUBE_BINARY_PATH="${KUBE_BINARY_DIRECTORY}/${KUBE_VERSION}/${KUBE_TAR_NAME}" + +curl --fail -o kubernetes-${KUBE_VERSION}.tar.gz "${KUBE_BINARY_PATH}"