FROM debian:latest
RUN apt-get update && \
	 apt-get install \
	 curl \
	 python3 \
	 python3-pip \
	 python3-requests \
	 python3-pandas \
	 python3-html2text \
	 tox \
	 git \
	 openjdk-11-jdk-headless \
	 python-autopep8 \
     python3-pytest \
     libxml2 \
	 -y
COPY .docker/wait-for-it.sh /wait-for-it.sh
ADD https://gitlab.com/api/v4/projects/13656973/repository/branches/dev \
   pylib_version.json
RUN git clone https://gitlab.com/caosdb/caosdb-pylib.git && \
   cd caosdb-pylib && git checkout dev && pip3 install .
ADD https://gitlab.com/api/v4/projects/13656965/repository/branches/master \
   model_version.json
RUN git clone https://gitlab.com/caosdb/caosdb-models.git && \
   cd caosdb-models && pip3 install .
ADD https://gitlab.com/api/v4/projects/13601752/repository/branches/master \
   scifolder_version.json
RUN git clone \
    https://gitlab.com/henrik_indiscale/scifolder.git && \
    cd scifolder && pip3 install .
COPY . /git
RUN rm -r /git/.git \
    && mv /git/.docker/pycaosdb.ini /git/integrationtests
RUN cd /git && pip3 install .
WORKDIR /git/integrationtests
CMD /wait-for-it.sh caosdb-server:10443 -t 500 -- ./test.sh