Skip to content

Commit

Permalink
add a way to discover git version from a built release
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedanese committed Nov 18, 2015
1 parent 65cdb12 commit ae05eed
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,8 @@ function kube::release::package_full_tarball() {
mkdir -p "${release_stage}/contrib/completions/bash"
cp "${KUBE_ROOT}/contrib/completions/bash/kubectl" "${release_stage}/contrib/completions/bash"

echo "${KUBE_GIT_VERSION}" > "${release_stage}/version"

kube::release::clean_cruft

local package_name="${RELEASE_DIR}/kubernetes.tar.gz"
Expand Down
21 changes: 21 additions & 0 deletions cluster/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -332,3 +332,24 @@ function find-release-tars() {
exit 1
fi
}

# Discover the git version of the current build package
#
# Assumed vars:
# KUBE_ROOT
# Vars set:
# KUBE_GIT_VERSION
function find-release-version() {
KUBE_GIT_VERSION=""
if [[ -f "${KUBE_ROOT}/version" ]]; then
KUBE_GIT_VERSION="$(cat ${KUBE_ROOT}/version)"
fi
if [[ -f "${KUBE_ROOT}/_output/full/kubernetes/version" ]]; then
KUBE_GIT_VERSION="$(cat ${KUBE_ROOT}/_output/full/kubernetes/version)"
fi

if [[ -z "${KUBE_GIT_VERSION}" ]]; then
echo "!!! Cannot find release version"
exit 1
fi
}

0 comments on commit ae05eed

Please sign in to comment.