diff options
| author | Shyam Sunder <sgsunder1@gmail.com> | 2020-06-05 12:47:23 -0400 |
|---|---|---|
| committer | Shyam Sunder <sgsunder1@gmail.com> | 2020-06-05 12:47:23 -0400 |
| commit | c06aaa63af977e64ef08bfba7829214f0f0ed38e (patch) | |
| tree | ca8e1ab9fa46e44e8343903395aa162af3b70356 /server/hooks/test | |
| parent | 454685755bc3be4b651d44509e135990c72923f5 (diff) | |
dev: add pre-commit hooks for pytest and docker building
Diffstat (limited to 'server/hooks/test')
| -rwxr-xr-x | server/hooks/test | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/server/hooks/test b/server/hooks/test index 056ca2c..bf7776d 100755 --- a/server/hooks/test +++ b/server/hooks/test @@ -1,34 +1,8 @@ #!/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 -RUN apk --no-cache add \ - py3-pip \ - py3-pytest \ - py3-pytest-cov \ - postgresql \ - && \ - pip3 install \ - --no-cache-dir \ - --disable-pip-version-check \ - pytest-pgsql \ - freezegun -USER app -ENV POSTGRES_HOST=x \ - POSTGRES_USER=x \ - POSTGRES_PASSWORD=x -CMD ["pytest", "szurubooru/", \ - "--cov-report=term-missing", "--cov=szurubooru", "--tb=short"] -EOF - +docker build -f ${DOCKERFILE_PATH:-Dockerfile}.test -t ${IMAGE_NAME}-test . docker run --rm -t ${IMAGE_NAME}-test +docker rmi ${IMAGE_NAME}-test exit $? |