From 8f57d0526f5df2d1ad88760d9248dd4fad2a7d94 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20tom=20W=C3=B6rden?= <h.tomwoerden@indiscale.com>
Date: Tue, 21 Jan 2020 13:49:41 +0000
Subject: [PATCH] ENH: Allow setting of pylib version

---
 .docker/Dockerfile | 5 +++--
 .gitlab-ci.yml     | 1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.docker/Dockerfile b/.docker/Dockerfile
index 9a18861..3ab2375 100644
--- a/.docker/Dockerfile
+++ b/.docker/Dockerfile
@@ -9,10 +9,11 @@ RUN apt-get update && \
 	 tox \
 	 -y
 COPY .docker/wait-for-it.sh /wait-for-it.sh
-ADD https://gitlab.com/api/v4/projects/13656973/repository/branches/dev \
+ARG PYLIB=dev
+ADD https://gitlab.com/api/v4/projects/13656973/repository/commits/${PYLIB} \
 	pylib_version.json
 RUN git clone https://gitlab.com/caosdb/caosdb-pylib.git && \
-   cd caosdb-pylib && pip3 install .
+   cd caosdb-pylib && git checkout ${PYLIB} && pip3 install .
 COPY . /git
 RUN rm -r /git/.git && mv /git/.docker/pycaosdb.ini /git 
 WORKDIR /git
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index e74e538..be3c255 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -123,6 +123,7 @@ build-testenv:
       - docker login -u indiscale -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
         # use here general latest or specific branch latest...
       - docker build 
+        --build-arg PYLIB=${PYLIB}
         --file .docker/Dockerfile
         -t $CI_REGISTRY_IMAGE:latest .
       - docker push $CI_REGISTRY_IMAGE:latest
-- 
GitLab