From 8c07dec7a91e6de3dd064c93d102e4328bc6e7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miloslav=20Trma=C4=8D?= Date: Thu, 31 Aug 2017 22:11:42 +0200 Subject: [PATCH] Use (git clone --depth=1) to speed up testing This reduces the time used to clone openshift/origin on Travis from > real 2m34.227s > user 4m18.844s > sys 0m8.144s to > real 0m8.816s > user 0m2.640s > sys 0m0.856s , and the download size from 782.78 MiB to 70.05 MiB . We can't trivially do this for docker/distribution because it is using (git checkout $commit) on the cloned repo; we could do a clone+fetch+fetch with --depth=1, but the full clone takes less than two seconds, so let's keep that one simple. --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index ff833c24..0ddf94f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -29,7 +29,7 @@ RUN set -x \ RUN set -x \ && yum install -y which git tar wget hostname util-linux bsdtar socat ethtool device-mapper iptables tree findutils nmap-ncat e2fsprogs xfsprogs lsof docker iproute \ && export GOPATH=$(mktemp -d) \ - && git clone -b v1.5.0-alpha.3 git://github.com/openshift/origin "$GOPATH/src/github.com/openshift/origin" \ + && git clone --depth 1 -b v1.5.0-alpha.3 git://github.com/openshift/origin "$GOPATH/src/github.com/openshift/origin" \ && (cd "$GOPATH/src/github.com/openshift/origin" && make clean build && make all WHAT=cmd/dockerregistry) \ && cp -a "$GOPATH/src/github.com/openshift/origin/_output/local/bin/linux"/*/* /usr/local/bin \ && cp "$GOPATH/src/github.com/openshift/origin/images/dockerregistry/config.yml" /atomic-registry-config.yml \