2019-09-28 05:18:28 +02:00
|
|
|
#!/bin/sh
|
|
|
|
set -e
|
|
|
|
|
|
|
|
docker build \
|
|
|
|
--build-arg BASE_IMAGE=${IMAGE_NAME} \
|
|
|
|
--file - \
|
|
|
|
--tag ${IMAGE_NAME}-test \
|
|
|
|
. <<'EOF'
|
|
|
|
ARG BASE_IMAGE
|
|
|
|
FROM ${BASE_IMAGE}
|
|
|
|
WORKDIR /opt/app
|
|
|
|
USER root
|
2019-09-30 00:39:16 +02:00
|
|
|
RUN apk --no-cache add \
|
|
|
|
py3-pytest \
|
|
|
|
py3-pytest-cov \
|
2020-03-07 00:14:16 +01:00
|
|
|
postgresql \
|
2019-09-30 00:39:16 +02:00
|
|
|
&& \
|
|
|
|
pip3 install \
|
|
|
|
--no-cache-dir \
|
|
|
|
--disable-pip-version-check \
|
2020-03-07 00:14:16 +01:00
|
|
|
pytest-pgsql \
|
2019-09-30 00:39:16 +02:00
|
|
|
freezegun
|
2019-09-28 05:18:28 +02:00
|
|
|
USER app
|
|
|
|
ENV POSTGRES_HOST=x \
|
|
|
|
POSTGRES_USER=x \
|
2020-03-08 04:17:51 +01:00
|
|
|
POSTGRES_PASSWORD=x
|
2019-09-28 05:18:28 +02:00
|
|
|
CMD ["pytest", "szurubooru/", \
|
|
|
|
"--cov-report=term-missing", "--cov=szurubooru", "--tb=short"]
|
|
|
|
EOF
|
|
|
|
|
2019-09-30 00:39:16 +02:00
|
|
|
docker run --rm -t ${IMAGE_NAME}-test
|
|
|
|
|
|
|
|
exit $?
|