Avoid downloading git history 65/61665/9
authorCédric Ollivier <cedric.ollivier@orange.com>
Fri, 31 Aug 2018 13:58:14 +0000 (15:58 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sat, 1 Sep 2018 15:31:48 +0000 (17:31 +0200)
It decreases container build duration.
depth 1 is set only when TAG is not a commit id because
github.com doesn't advertise commit ids.

It switches to git.openstack.org as much as possible.

Change-Id: I3ad7a38eda0f7023302d71bb55de23828120f599
Signed-off-by: Cédric Ollivier <cedric.ollivier@orange.com>
docker/core/Dockerfile
docker/features/Dockerfile
docker/healthcheck/Dockerfile
docker/smoke/Dockerfile
docker/tempest/Dockerfile
docker/vnf/Dockerfile

index 9a5348c..af01347 100644 (file)
@@ -15,8 +15,8 @@ RUN apk --no-cache add --update \
     pip install --no-cache-dir --src /src -cupper-constraints.txt \
         -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG \
         pip==$PIP_TAG && \
-    git clone https://gerrit.opnfv.org/gerrit/functest /src/functest && \
-    (cd /src/functest && git fetch origin $BRANCH && git checkout FETCH_HEAD) && \
+    git clone --depth 1 https://gerrit.opnfv.org/gerrit/functest /src/functest && \
+    (cd /src/functest && git fetch --tags origin $BRANCH && git checkout FETCH_HEAD) && \
     pip install --no-cache-dir --src /src -cupper-constraints.txt \
         -chttps://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG \
         /src/functest && \
index dcd9089..7024f96 100644 (file)
@@ -10,7 +10,7 @@ RUN apk --no-cache add --update python3 sshpass && \
         python-dev python3-dev build-base linux-headers libffi-dev \
         openssl-dev libjpeg-turbo-dev && \
     wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
-        sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ \
+        sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/git.openstack.org\\/openstack\\/tempest@\\1#egg=tempest/ \
         > upper-constraints.txt && \
     wget -q -O- https://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH | \
         sed -E /#egg=functest/d > upper-constraints.opnfv.txt && \
index e78d81c..004aa5d 100644 (file)
@@ -6,14 +6,14 @@ ARG ODL_TAG=85448c9d97b89989488e675b29b38ac42d8674e4
 
 COPY thirdparty-requirements.txt thirdparty-requirements.txt
 RUN wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
-        sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ \
+        sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/git.openstack.org\\/openstack\\/tempest@\\1#egg=tempest/ \
         > upper-constraints.txt && \
     wget -q -O- https://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH | \
         sed -E /#egg=functest/d > upper-constraints.opnfv.txt && \
     pip install --no-cache-dir --src /src -cupper-constraints.txt -cupper-constraints.opnfv.txt \
         -rthirdparty-requirements.txt && \
-    git clone https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test && \
-    (cd /src/odl_test && git checkout $ODL_TAG) && \
+    git clone --depth 1 https://git.opendaylight.org/gerrit/p/integration/test.git /src/odl_test && \
+    (cd /src/odl_test && git fetch --tags origin $ODL_TAG && git checkout FETCH_HEAD) && \
     rm -r /src/odl_test/.git thirdparty-requirements.txt upper-constraints.txt \
         upper-constraints.opnfv.txt
 COPY testcases.yaml /usr/lib/python2.7/site-packages/xtesting/ci/testcases.yaml
index 31b67e8..7e4939a 100644 (file)
@@ -13,21 +13,21 @@ RUN apk --no-cache add --update libxml2 libxslt && \
         python-dev build-base linux-headers libffi-dev \
         openssl-dev libjpeg-turbo-dev libxml2-dev libxslt-dev && \
     wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
-        sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ \
+        sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/git.openstack.org\\/openstack\\/tempest@\\1#egg=tempest/ \
         > upper-constraints.txt && \
     wget -q -O- https://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH | \
         sed -E /#egg=functest/d > upper-constraints.opnfv.txt && \
-    git clone https://github.com/openstack/patrole.git /src/patrole && \
-    (cd /src/patrole && git checkout $PATROLE_TAG) && \
+    git clone --depth 1 https://git.openstack.org/openstack/patrole.git /src/patrole && \
+    (cd /src/patrole && git fetch --tags origin $PATROLE_TAG && git checkout FETCH_HEAD) && \
     update-requirements -s --source /src/openstack-requirements /src/patrole/ && \
-    git clone https://github.com/openstack/vmtp.git /src/vmtp && \
-    (cd /src/vmtp && git fetch origin $VMTP_TAG && git checkout FETCH_HEAD) && \
+    git clone https://git.openstack.org/openstack/vmtp.git /src/vmtp && \
+    (cd /src/vmtp && git fetch origin --tags $VMTP_TAG && git checkout FETCH_HEAD) && \
     update-requirements -s --source /src/openstack-requirements /src/vmtp/ && \
-    git clone https://github.com/openstack/neutron-tempest-plugin.git /src/neutron-tempest-plugin && \
-    (cd /src/neutron-tempest-plugin && git fetch origin $NEUTRON_TAG && git checkout FETCH_HEAD) && \
+    git clone https://git.openstack.org/openstack/neutron-tempest-plugin.git /src/neutron-tempest-plugin && \
+    (cd /src/neutron-tempest-plugin && git fetch --tags origin $NEUTRON_TAG && git checkout FETCH_HEAD) && \
     update-requirements -s --source /src/openstack-requirements /src/neutron-tempest-plugin && \
-    git clone https://github.com/openstack/barbican-tempest-plugin.git /src/barbican-tempest-plugin && \
-    (cd /src/barbican-tempest-plugin && git fetch origin $BARBICAN_TAG && git checkout FETCH_HEAD) && \
+    git clone https://git.openstack.org/openstack/barbican-tempest-plugin.git /src/barbican-tempest-plugin && \
+    (cd /src/barbican-tempest-plugin && git fetch --tags origin $BARBICAN_TAG && git checkout FETCH_HEAD) && \
     update-requirements -s --source /src/openstack-requirements /src/barbican-tempest-plugin/ && \
     pip install --no-cache-dir --src /src -cupper-constraints.txt -cupper-constraints.opnfv.txt \
         /src/patrole /src/barbican-tempest-plugin /src/neutron-tempest-plugin \
@@ -38,8 +38,8 @@ RUN apk --no-cache add --update libxml2 libxslt && \
     wget "https://refstack.openstack.org/api/v1/guidelines/${REFSTACK_TARGET}/tests?target=compute&type=required&alias=true&flag=false" \
         -O /home/opnfv/functest/data/refstack/defcore.txt && \
     mkdir -p /etc/neutron /etc/glance && \
-    wget -q -O /etc/neutron/policy.json https://raw.githubusercontent.com/openstack/neutron/$OPENSTACK_TAG/etc/policy.json && \
-    wget -q -O /etc/glance/policy.json https://raw.githubusercontent.com/openstack/glance/$OPENSTACK_TAG/etc/policy.json && \
+    wget -q -O /etc/neutron/policy.json https://git.openstack.org/cgit/openstack/neutron/plain/etc/policy.json?h=$OPENSTACK_TAG && \
+    wget -q -O /etc/glance/policy.json https://git.openstack.org/cgit/openstack/glance/plain/etc/policy.json?h=$OPENSTACK_TAG && \
     apk del .build-deps
 COPY testcases.yaml /usr/lib/python2.7/site-packages/xtesting/ci/testcases.yaml
 CMD ["run_tests", "-t", "all"]
index dc9c9de..dc142f4 100644 (file)
@@ -12,25 +12,25 @@ RUN apk --no-cache add --virtual .build-deps --update \
     case $OPENSTACK_TAG in \
     master) \
         wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
-            sed -E s/^tempest==+.*$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest#egg=tempest/ \
+            sed -E s/^tempest==+.*$/-e\ git+https:\\/\\/git.openstack.org\\/openstack\\/tempest#egg=tempest/ \
             > upper-constraints.txt ;; \
     *) \
         wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
-            sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ \
+            sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/git.openstack.org\\/openstack\\/tempest@\\1#egg=tempest/ \
             > upper-constraints.txt ;; \
     esac && \
     wget -q -O- https://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH | \
         sed -E /#egg=functest/d > upper-constraints.opnfv.txt && \
     pip install --no-cache-dir --src /src -cupper-constraints.txt -cupper-constraints.opnfv.txt \
-        -e git+https://github.com/openstack/requirements@$OPENSTACK_TAG#egg=openstack_requirements && \
-    git clone https://github.com/openstack/os-faults.git /src/os-faults && \
-    (cd /src/os-faults && git checkout $OS_FAULTS_TAG) && \
+        -e git+https://git.openstack.org/openstack/requirements@$OPENSTACK_TAG#egg=openstack_requirements && \
+    git clone --depth 1 https://git.openstack.org/openstack/os-faults.git /src/os-faults && \
+    (cd /src/os-faults && git fetch --tags origin $OS_FAULTS_TAG && git checkout FETCH_HEAD) && \
     update-requirements -s --source /src/openstack-requirements /src/os-faults/ && \
-    git clone https://github.com/openstack/rally.git /src/rally && \
-    (cd /src/rally && git checkout $RALLY_TAG) && \
+    git clone --depth 1 https://git.openstack.org/openstack/rally.git /src/rally && \
+    (cd /src/rally && git fetch --tags origin $RALLY_TAG && git checkout FETCH_HEAD) && \
     update-requirements -s --source /src/openstack-requirements /src/rally/ && \
-    git clone https://github.com/openstack/rally-openstack.git /src/rally-openstack && \
-    (cd /src/rally-openstack && git checkout $RALLY_OPENSTACK_TAG) && \
+    git clone --depth 1 https://git.openstack.org/openstack/rally-openstack.git /src/rally-openstack && \
+    (cd /src/rally-openstack && git fetch --tags origin $RALLY_OPENSTACK_TAG && git checkout FETCH_HEAD) && \
     update-requirements -s --source /src/openstack-requirements /src/rally-openstack && \
     pip install --no-cache-dir --src /src -cupper-constraints.txt -cupper-constraints.opnfv.txt \
         tempest /src/rally-openstack /src/os-faults && \
index b7e5621..310ec0c 100644 (file)
@@ -20,7 +20,7 @@ RUN apk --no-cache add --update \
     apk --no-cache add --virtual .build-deps --update \
         ruby-dev g++ make libxslt-dev libxml2-dev zlib-dev libffi-dev g++ make && \
     wget -q -O- https://git.openstack.org/cgit/openstack/requirements/plain/upper-constraints.txt?h=$OPENSTACK_TAG | \
-        sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/github.com\\/openstack\\/tempest@\\1#egg=tempest/ | \
+        sed -E s/^tempest==+\(.*\)$/-e\ git+https:\\/\\/git.openstack.org\\/openstack\\/tempest@\\1#egg=tempest/ \
         > upper-constraints.txt && \
     wget -q -O- https://git.opnfv.org/functest/plain/upper-constraints.txt?h=$BRANCH | \
         sed -E /#egg=functest/d > upper-constraints.opnfv.txt && \
@@ -32,7 +32,7 @@ RUN apk --no-cache add --update \
     git clone --depth 1 -b $CLOUDIFY_VIMS_TAG https://github.com/Orange-OpenSource/opnfv-cloudify-clearwater.git /src/cloudify_vims && \
     git clone --depth 1 -b $HEAT_VIMS_TAG https://github.com/Metaswitch/clearwater-heat.git /src/heat_vims && \
     git clone --depth 1 -b $VROUTER_TAG https://github.com/oolorg/opnfv-vnf-vyos-blueprint.git /src/opnfv-vnf-vyos-blueprint && \
-    git clone https://github.com/RebacaInc/abot_charm.git /src/epc-requirements/abot_charm && \
+    git clone --depth 1 https://github.com/RebacaInc/abot_charm.git /src/epc-requirements/abot_charm && \
     python3 -m pip install --no-cache-dir --src /src -cupper-constraints.txt -cupper-constraints.opnfv.txt \
         juju-wait==$JUJU_WAIT_TAG && \
     go get github.com/rogpeppe/godeps && \