diff --git a/docs/devel/releasing.md b/docs/devel/releasing.md index d4347ce44cd6a..757048ad64ee8 100644 --- a/docs/devel/releasing.md +++ b/docs/devel/releasing.md @@ -92,22 +92,24 @@ release from HEAD of the branch, (because you have to do some version-rev commits,) so choose the latest build on the release branch. (Remember, that branch should be frozen.) -Once you find some greens, you can find the git hash for a build by looking at -the Full Console Output and searching for `githash=`. You should see a line: +Once you find some greens, you can find the build hash for a build by looking at +the Full Console Output and searching for `build_version=`. You should see a line: ```console -githash=v1.2.0-alpha.2.164+b44c7d79d6c9bb +build_version=v1.2.0-alpha.2.164+b44c7d79d6c9bb ``` Or, if you're cutting from a release branch (i.e. doing an official release), ```console -githash=v1.1.0-beta.567+d79d6c9bbb44c7 +build_version=v1.1.0-beta.567+d79d6c9bbb44c7 ``` +Please note that `build_version` was called `githash` versions prior to v1.2. + Because Jenkins builds frequently, if you're looking between jobs (e.g. `kubernetes-e2e-gke-ci` and `kubernetes-e2e-gce`), there may be no single -`githash` that's been run on both jobs. In that case, take the a green +`build_version` that's been run on both jobs. In that case, take the a green `kubernetes-e2e-gce` build (but please check that it corresponds to a temporally similar build that's green on `kubernetes-e2e-gke-ci`). Lastly, if you're having trouble understanding why the GKE continuous integration clusters are failing @@ -117,10 +119,10 @@ oncall. Before proceeding to the next step: ```sh -export GITHASH=v1.2.0-alpha.2.164+b44c7d79d6c9bb +export BUILD_VERSION=v1.2.0-alpha.2.164+b44c7d79d6c9bb ``` -Where `v1.2.0-alpha.2.164+b44c7d79d6c9bb` is the git hash you decided on. This +Where `v1.2.0-alpha.2.164+b44c7d79d6c9bb` is the build hash you decided on. This will become your release point. ### Cutting/branching the release @@ -136,15 +138,15 @@ or `git checkout upstream/master` from an existing repo. Decide what version you're cutting and export it: -- alpha release: `export VER="vX.Y.0-alpha.W"`; -- beta release: `export VER="vX.Y.Z-beta.W"`; -- official release: `export VER="vX.Y.Z"`; -- new release series: `export VER="vX.Y"`. +- alpha release: `export RELEASE_VERSION="vX.Y.0-alpha.W"`; +- beta release: `export RELEASE_VERSION="vX.Y.Z-beta.W"`; +- official release: `export RELEASE_VERSION="vX.Y.Z"`; +- new release series: `export RELEASE_VERSION="vX.Y"`. Then, run ```console -./release/cut-official-release.sh "${VER}" "${GITHASH}" +./release/cut-official-release.sh "${RELEASE_VERSION}" "${BUILD_VERSION}" ``` This will do a dry run of the release. It will give you instructions at the @@ -152,7 +154,7 @@ end for `pushd`ing into the dry-run directory and having a look around. `pushd` into the directory and make sure everythig looks as you expect: ```console -git log "${VER}" # do you see the commit you expect? +git log "${RELEASE_VERSION}" # do you see the commit you expect? make release ./cluster/kubectl.sh version -c ``` @@ -161,7 +163,7 @@ If you're satisfied with the result of the script, go back to `upstream/master` run ```console -./release/cut-official-release.sh "${VER}" "${GITHASH}" --no-dry-run +./release/cut-official-release.sh "${RELEASE_VERSION}" "${BUILD_VERSION}" --no-dry-run ``` and follow the instructions. @@ -185,10 +187,10 @@ notes, (see #17444 for more info). - Only publish a beta release if it's a standalone pre-release. (We create beta tags after we do official releases to maintain proper semantic versioning, *we don't publish these beta releases*.) Use - `./hack/cherry_pick_list.sh ${VER}` to get release notes for such a + `./hack/cherry_pick_list.sh ${RELEASE_VERSION}` to get release notes for such a release. - Official release: - - From your clone of upstream/master, run `./hack/cherry_pick_list.sh ${VER}` + - From your clone of upstream/master, run `./hack/cherry_pick_list.sh ${RELEASE_VERSION}` to get the release notes for the patch release you just created. Feel free to prune anything internal, but typically for patch releases we tend to include everything in the release notes. diff --git a/hack/jenkins/e2e.sh b/hack/jenkins/e2e.sh index 2af3e16ac5618..934618406b1c6 100755 --- a/hack/jenkins/e2e.sh +++ b/hack/jenkins/e2e.sh @@ -1276,32 +1276,32 @@ if [[ "${E2E_UP,,}" == "true" || "${JENKINS_FORCE_GET_TARS:-}" =~ ^[yY]$ ]]; the # "release/v0.19.1" IFS='/' read -a varr <<< "${JENKINS_EXPLICIT_VERSION}" bucket="${varr[0]}" - githash="${varr[1]}" - echo "Using explicit version $bucket/$githash" + build_version="${varr[1]}" + echo "Using explicit version $bucket/$build_version" elif [[ ${JENKINS_USE_SERVER_VERSION:-} =~ ^[yY]$ ]]; then # for GKE we can use server default version. bucket="release" msg=$(gcloud ${CMD_GROUP} container get-server-config --project=${PROJECT} --zone=${ZONE} | grep defaultClusterVersion) # msg will look like "defaultClusterVersion: 1.0.1". Strip # everything up to, including ": " - githash="v${msg##*: }" - echo "Using server version $bucket/$githash" + build_version="v${msg##*: }" + echo "Using server version $bucket/$build_version" else # use JENKINS_PUBLISHED_VERSION # Use a published version like "ci/latest" (default), # "release/latest", "release/latest-1", or "release/stable" IFS='/' read -a varr <<< "${JENKINS_PUBLISHED_VERSION}" bucket="${varr[0]}" - githash=$(gsutil cat gs://kubernetes-release/${JENKINS_PUBLISHED_VERSION}.txt) - echo "Using published version $bucket/$githash (from ${JENKINS_PUBLISHED_VERSION})" + build_version=$(gsutil cat gs://kubernetes-release/${JENKINS_PUBLISHED_VERSION}.txt) + echo "Using published version $bucket/$build_version (from ${JENKINS_PUBLISHED_VERSION})" fi # At this point, we want to have the following vars set: # - bucket - # - githash - gsutil -m cp gs://kubernetes-release/${bucket}/${githash}/kubernetes.tar.gz gs://kubernetes-release/${bucket}/${githash}/kubernetes-test.tar.gz . + # - build_version + gsutil -m cp gs://kubernetes-release/${bucket}/${build_version}/kubernetes.tar.gz gs://kubernetes-release/${bucket}/${build_version}/kubernetes-test.tar.gz . # Set by GKE-CI to change the CLUSTER_API_VERSION to the git version if [[ ! -z ${E2E_SET_CLUSTER_API_VERSION:-} ]]; then - export CLUSTER_API_VERSION=$(echo ${githash} | cut -c 2-) + export CLUSTER_API_VERSION=$(echo ${build_version} | cut -c 2-) fi fi @@ -1392,10 +1392,10 @@ fi # with a nonzero error code if it was only tests that failed. if [[ "${E2E_TEST,,}" == "true" ]]; then go run ./hack/e2e.go ${E2E_OPT} -v --test --test_args="${GINKGO_TEST_ARGS}" && exitcode=0 || exitcode=$? - if [[ "${E2E_PUBLISH_GREEN_VERSION:-}" == "true" && ${exitcode} == 0 && -n ${githash:-} ]]; then - echo "publish githash to ci/latest-green.txt: ${githash}" - echo "${githash}" > ${WORKSPACE}/githash.txt - gsutil cp ${WORKSPACE}/githash.txt gs://kubernetes-release/ci/latest-green.txt + if [[ "${E2E_PUBLISH_GREEN_VERSION:-}" == "true" && ${exitcode} == 0 && -n ${build_version:-} ]]; then + echo "publish build_version to ci/latest-green.txt: ${build_version}" + echo "${build_version}" > ${WORKSPACE}/build_version.txt + gsutil cp ${WORKSPACE}/build_version.txt gs://kubernetes-release/ci/latest-green.txt fi fi diff --git a/release/cut-official-release.sh b/release/cut-official-release.sh index e2ba6c4b9b56a..68e712c5b2945 100755 --- a/release/cut-official-release.sh +++ b/release/cut-official-release.sh @@ -29,8 +29,7 @@ function main() { exit 1 fi local -r new_version=${1-} - # TODO(ihmccreery) Stop calling it githash; it's not a githash. - local -r githash=${2-} + local -r build_version=${2-} DRY_RUN=true if [[ "${3-}" == "--no-dry-run" ]]; then echo "!!! This NOT is a dry run." @@ -73,13 +72,13 @@ function main() { exit 1 fi - # Get the git commit from the githash and verify it + # Get the git commit from the build_version and verify it local -r git_commit_regex="^[0-9a-f]{7}$" - local -r git_commit=$(echo "${githash}" | awk -F'+' '{print $2}' | head -c7) + local -r git_commit=$(echo "${build_version}" | awk -F'+' '{print $2}' | head -c7) if ! [[ "${git_commit}" =~ $git_commit_regex ]]; then usage echo - echo "!!! You specified an invalid githash '${githash}'." + echo "!!! You specified an invalid build_version '${build_version}'." echo "!!! Tried to extract commit, got ${git_commit}." exit 1 fi @@ -189,9 +188,11 @@ EOM } function usage() { - echo "Usage: ${0} [--no-dry-run]" + echo "Usage: ${0} [--no-dry-run]" echo - echo "See docs/devel/releasing.md for more info." + echo " is the version you want to release," + echo " is the version of the build you want to mark as ." + echo "Please see docs/devel/releasing.md for more info." } function check-prereqs() {