Skip to content

Commit

Permalink
Use git archive to produce kubernetes-src.tar.gz when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
ixdy committed Nov 22, 2017
1 parent 2b04a66 commit 96e2da2
Showing 1 changed file with 16 additions and 11 deletions.
27 changes: 16 additions & 11 deletions build/lib/release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,23 @@ function kube::release::package_tarballs() {

# Package the source code we built, for compliance/licensing/audit/yadda.
function kube::release::package_src_tarball() {
local -r src_tarball="${RELEASE_TARS}/kubernetes-src.tar.gz"
kube::log::status "Building tarball: src"
local source_files=(
$(cd "${KUBE_ROOT}" && find . -mindepth 1 -maxdepth 1 \
-not \( \
\( -path ./_\* -o \
-path ./.git\* -o \
-path ./.config\* -o \
-path ./.gsutil\* \
\) -prune \
\))
)
"${TAR}" czf "${RELEASE_TARS}/kubernetes-src.tar.gz" -C "${KUBE_ROOT}" "${source_files[@]}"
if [[ "${KUBE_GIT_TREE_STATE-}" == "clean" ]]; then
git archive -o "${src_tarball}" HEAD
else
local source_files=(
$(cd "${KUBE_ROOT}" && find . -mindepth 1 -maxdepth 1 \
-not \( \
\( -path ./_\* -o \
-path ./.git\* -o \
-path ./.config\* -o \
-path ./.gsutil\* \
\) -prune \
\))
)
"${TAR}" czf "${src_tarball}" -C "${KUBE_ROOT}" "${source_files[@]}"
fi
}

# Package up all of the cross compiled clients. Over time this should grow into
Expand Down

0 comments on commit 96e2da2

Please sign in to comment.