Skip to content

Commit

Permalink
Merge pull request kubernetes#2076 from jbeda/1902-clean-tars
Browse files Browse the repository at this point in the history
Don't include '.' in release tars.
  • Loading branch information
lavalamp committed Oct 30, 2014
2 parents 64574dc + 33869ab commit b2b090c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 5 deletions.
32 changes: 28 additions & 4 deletions build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ function kube::release::package_client_tarballs() {
"${release_stage}/client/bin/"

local package_name="${RELEASE_DIR}/kubernetes-client-${platform_tag}.tar.gz"
tar czf "${package_name}" -C "${release_stage}/.." .
kube::release::create_tarball "${package_name}" "${release_stage}/.."
done
}

Expand All @@ -486,7 +486,7 @@ function kube::release::package_server_tarballs() {
"${release_stage}/server/bin/"

local package_name="${RELEASE_DIR}/kubernetes-server-${platform_tag}.tar.gz"
tar czf "${package_name}" -C "${release_stage}/.." .
kube::release::create_tarball "${package_name}" "${release_stage}/.."
done
}

Expand All @@ -502,7 +502,7 @@ function kube::release::package_salt_tarball() {
cp -R "${KUBE_ROOT}/cluster/saltbase" "${release_stage}/"

local package_name="${RELEASE_DIR}/kubernetes-salt.tar.gz"
tar czf "${package_name}" -C "${release_stage}/.." .
kube::release::create_tarball "${package_name}" "${release_stage}/.."
}

# This is all the stuff you need to run/install kubernetes. This includes:
Expand Down Expand Up @@ -537,9 +537,33 @@ function kube::release::package_full_tarball() {
cp "${KUBE_ROOT}/Vagrantfile" "${release_stage}/"

local package_name="${RELEASE_DIR}/kubernetes.tar.gz"
tar czf "${package_name}" -C "${release_stage}/.." .
kube::release::create_tarball "${package_name}" "${release_stage}/.."
}

# Build a release tarball. $1 is the output tar name. $2 is the base directory
# of the files to be packaged. This assumes that ${2}/kubernetes is what is
# being packaged.
function kube::release::create_tarball() {
local tarfile=$1
local stagingdir=$2

# Find gnu tar if it is available
local tar=tar
if which gtar > /dev/null; then
tar=gtar
fi

local tar_cmd=("$tar" "czf" "${tarfile}" "-C" "${stagingdir}" "kubernetes")
if "$tar" --version | grep -q GNU; then
tar_cmd=("${tar_cmd[@]}" "--owner=0" "--group=0")
else
echo " !!! GNU tar not available. User names will be embedded in output and"
echo " release tars are not official. Build on Linux or install GNU tar"
echo " on Mac OS X (brew install gnu-tar)"
fi

"${tar_cmd[@]}"
}

# ---------------------------------------------------------------------------
# GCS Release
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started-guides/binary_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ You can either build a release from sources or download a pre-built release. If

Soon, we will have a list of numbered and nightly releases. Until then, you can download a development release/snapshot from [here](http://storage.googleapis.com/kubernetes-releases-56726/devel/kubernetes.tar.gz).

Unpack this tar file on Linux or OS X. Most guides assume you are in the `kubernetes/` directory.
Unpack this tar file on Linux or OS X. Unpack this tar file on Linux or OS X, cd to the created `kubernetes/` directory, and then follow the getting started guide for your cloud.

### Building from source

Expand Down

0 comments on commit b2b090c

Please sign in to comment.