Skip to content

Commit

Permalink
add documentation and script on how to get recent and "nightly" builds
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedanese committed Jun 29, 2015
1 parent 719870f commit c053b9a
Show file tree
Hide file tree
Showing 3 changed files with 96 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/devel/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)]()
24 changes: 24 additions & 0 deletions docs/devel/getting-builds.md
Original file line number Diff line number Diff line change
@@ -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)]()
70 changes: 70 additions & 0 deletions hack/get-build.sh
Original file line number Diff line number Diff line change
@@ -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}"

0 comments on commit c053b9a

Please sign in to comment.