Clone the corresponding branch of the repo according to the job branch 49/25249/1
authorjose.lausuch <jose.lausuch@ericsson.com>
Wed, 30 Nov 2016 14:42:53 +0000 (15:42 +0100)
committerjose.lausuch <jose.lausuch@ericsson.com>
Wed, 30 Nov 2016 14:43:36 +0000 (15:43 +0100)
Make use of the ARG BRANCH given at build time

cmd="docker build --no-cache -t $DOCKER_REPO_NAME:$DOCKER_TAG
--build-arg BRANCH=$branch ."

Change-Id: I44d342bfa5499ebd119e9147695ea82853eb64b6
Signed-off-by: jose.lausuch <jose.lausuch@ericsson.com>
docker/Dockerfile

index fb8625e..048804d 100644 (file)
@@ -57,8 +57,8 @@ RUN apt-get -y autoremove && \
 RUN mkdir -p ${REPOS_DIR}
 
 RUN git config --global http.sslVerify false
-RUN git clone https://gerrit.opnfv.org/gerrit/yardstick ${YARDSTICK_REPO_DIR}
-RUN git clone https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR}
+RUN git clone --depth 1 -b $BRANCH https://gerrit.opnfv.org/gerrit/yardstick ${YARDSTICK_REPO_DIR}
+RUN git clone --depth 1 https://gerrit.opnfv.org/gerrit/releng ${RELENG_REPO_DIR}
 
 # install yardstick + dependencies
 RUN cd ${YARDSTICK_REPO_DIR} && easy_install -U pip