Skip to content

Commit fda99a7

Browse files
committed
Change the windows .tgz to a .zip file
Signed-off-by: Ken Cochrane <[email protected]>
1 parent b27f17c commit fda99a7

4 files changed

Lines changed: 42 additions & 14 deletions

File tree

Dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ RUN apt-get update && apt-get install -y \
7474
xfsprogs \
7575
libzfs-dev \
7676
tar \
77+
zip \
7778
--no-install-recommends \
7879
&& pip install awscli==1.10.15 \
7980
&& ln -snf /usr/bin/clang-3.8 /usr/local/bin/clang \

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,11 @@ bundles:
7272
cross: build
7373
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary binary cross
7474

75-
7675
win: build
7776
$(DOCKER_RUN_DOCKER) hack/make.sh win
7877

78+
tgz: build
79+
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary binary cross tgz
7980

8081
deb: build
8182
$(DOCKER_RUN_DOCKER) hack/make.sh dynbinary build-deb

hack/make/tgz

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,17 @@ for d in "$CROSS/"*/*; do
1515
export GOOS="$(basename "$(dirname "$d")")"
1616
BINARY_NAME="docker-$VERSION"
1717
BINARY_EXTENSION="$(export GOOS && binary_extension)"
18+
if [ "$GOOS" = 'windows' ]; then
19+
# if windows use a zip, not tgz
20+
BUNDLE_EXTENSION=".zip"
21+
IS_TAR="false"
22+
else
23+
BUNDLE_EXTENSION=".tgz"
24+
IS_TAR="true"
25+
fi
1826
BINARY_FULLNAME="$BINARY_NAME$BINARY_EXTENSION"
1927
mkdir -p "$DEST/$GOOS/$GOARCH"
20-
TGZ="$DEST/$GOOS/$GOARCH/$BINARY_NAME.tgz"
28+
TGZ="$DEST/$GOOS/$GOARCH/$BINARY_NAME$BUNDLE_EXTENSION"
2129

2230
# The staging directory for the files in the tgz
2331
BUILD_PATH="$DEST/build"
@@ -35,8 +43,21 @@ for d in "$CROSS/"*/*; do
3543
# copy over all the containerd binaries
3644
copy_containerd $TAR_PATH
3745

38-
echo "Creating tgz from $BUILD_PATH and naming it $TGZ"
39-
tar --numeric-owner --owner 0 -C "$BUILD_PATH" -czf "$TGZ" $TAR_BASE_DIRECTORY
46+
if [ "$IS_TAR" == "true" ]; then
47+
echo "Creating tgz from $BUILD_PATH and naming it $TGZ"
48+
tar --numeric-owner --owner 0 -C "$BUILD_PATH" -czf "$TGZ" $TAR_BASE_DIRECTORY
49+
else
50+
# ZIP needs to full absolute dir path, not the absolute path
51+
ZIP=`pwd`"/$TGZ"
52+
# keep track of where we are, for later.
53+
pushd .
54+
# go into the BUILD_PATH since zip does not have a -C equivalent.
55+
cd $BUILD_PATH
56+
echo "Creating zip from $BUILD_PATH and naming it $ZIP"
57+
zip -q -r $ZIP $TAR_BASE_DIRECTORY
58+
# go back to where we started
59+
popd
60+
fi
4061

4162
hash_files "$TGZ"
4263

hack/release.sh

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,9 @@ release_build() {
181181
binDir=bundles/$VERSION/cross/$GOOS/$GOARCH
182182
tgzDir=bundles/$VERSION/tgz/$GOOS/$GOARCH
183183
binary=docker-$VERSION
184-
tgz=docker-$VERSION.tgz
184+
zipExt=".tgz"
185+
binaryExt=""
186+
tgz=$binary$zipExt
185187

186188
latestBase=
187189
if [ -z "$NOLATEST" ]; then
@@ -204,11 +206,12 @@ release_build() {
204206
s3Os=Linux
205207
;;
206208
windows)
209+
# this is windows use the .zip and .exe extentions for the files.
207210
s3Os=Windows
208-
binary+='.exe'
209-
if [ "$latestBase" ]; then
210-
latestBase+='.exe'
211-
fi
211+
zipExt=".zip"
212+
binaryExt=".exe"
213+
tgz=$binary$zipExt
214+
binary+=$binaryExt
212215
;;
213216
*)
214217
echo >&2 "error: can't convert $s3Os to an appropriate value for 'uname -s'"
@@ -235,11 +238,13 @@ release_build() {
235238
esac
236239

237240
s3Dir="s3://$BUCKET_PATH/builds/$s3Os/$s3Arch"
238-
latest=
241+
# latest=
239242
latestTgz=
240243
if [ "$latestBase" ]; then
241-
latest="$s3Dir/$latestBase"
242-
latestTgz="$s3Dir/$latestBase.tgz"
244+
# commented out since we aren't uploading binaries right now.
245+
# latest="$s3Dir/$latestBase$binaryExt"
246+
# we don't include the $binaryExt because we don't want docker.exe.zip
247+
latestTgz="$s3Dir/$latestBase$zipExt"
243248
fi
244249

245250
if [ ! -f "$tgzDir/$tgz" ]; then
@@ -308,6 +313,6 @@ echo "We have just pushed $VERSION to $(s3_url). You can download it with the fo
308313
echo
309314
echo "Darwin/OSX 64bit client tgz: $(s3_url)/builds/Darwin/x86_64/docker-$VERSION.tgz"
310315
echo "Linux 64bit tgz: $(s3_url)/builds/Linux/x86_64/docker-$VERSION.tgz"
311-
echo "Windows 64bit client tgz: $(s3_url)/builds/Windows/x86_64/docker-$VERSION.tgz"
312-
echo "Windows 32bit client tgz: $(s3_url)/builds/Windows/i386/docker-$VERSION.tgz"
316+
echo "Windows 64bit client tgz: $(s3_url)/builds/Windows/x86_64/docker-$VERSION.zip"
317+
echo "Windows 32bit client tgz: $(s3_url)/builds/Windows/i386/docker-$VERSION.zip"
313318
echo

0 commit comments

Comments
 (0)