Permalink
Browse files

release scripts respect TMPDIR

  • Loading branch information...
ihmccreery committed Apr 28, 2016
1 parent a9c0046 commit 2ba635b2cddf7e4ede7d986873a544be9af9e287
Showing with 5 additions and 3 deletions.
  1. +2 −1 release/build-official-release.sh
  2. +3 −2 release/cut-official-release.sh
@@ -43,6 +43,7 @@ function sha1() {
declare -r KUBE_GITHUB="https://github.com/kubernetes/kubernetes.git"
declare -r KUBE_RELEASE_VERSION=${1-}
+declare -r TMPDIR=${TMPDIR:-"/tmp"}
declare -r KUBE_RELEASE_UMASK=${KUBE_RELEASE_UMASK:-022}
VERSION_REGEX="^v(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(-(beta|alpha)\\.(0|[1-9][0-9]*))?$"
@@ -65,7 +66,7 @@ else
KUBE_RELEASE_TYPE="stable"
fi
-declare -r KUBE_BUILD_DIR=$(mktemp -d "/tmp/kubernetes-build-release-${KUBE_RELEASE_VERSION}-XXXXXXX")
+declare -r KUBE_BUILD_DIR=$(mktemp -d "${TMPDIR}/kubernetes-build-release-${KUBE_RELEASE_VERSION}-XXXXXXX")
# Set the default umask for the release. This ensures consistency
# across our release builds.
@@ -92,11 +92,12 @@ function main() {
local -r release_umask=${release_umask:-022}
umask "${release_umask}"
+ declare -r TMPDIR=${TMPDIR:-"/tmp"}
local -r github="https://github.com/kubernetes/kubernetes.git"
- declare -r DIR=$(mktemp -d "/tmp/kubernetes-${release_type}-release-${new_version}-XXXXXXX")
+ declare -r DIR=$(mktemp -d "${TMPDIR}/kubernetes-${release_type}-release-${new_version}-XXXXXXX")
# Start a tmp file that will hold instructions for the user.
- declare -r INSTRUCTIONS=$(mktemp "/tmp/kubernetes-${release_type}-release-${new_version}-instructions-XXXXXXX")
+ declare -r INSTRUCTIONS=$(mktemp "${TMPDIR}/kubernetes-${release_type}-release-${new_version}-instructions-XXXXXXX")
if $DRY_RUN; then
cat > "${INSTRUCTIONS}" <<- EOM
Success on dry run! Do

0 comments on commit 2ba635b

Please sign in to comment.