-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
47 lines (38 loc) · 995 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
ARG PYTHON_VERSION=3.10
FROM python:${PYTHON_VERSION} as base
WORKDIR /srv
COPY . .
# hadolint ignore=DL3042,DL3013
RUN set -x \
&& pip install poetry \
&& poetry config virtualenvs.create false \
&& poetry install
FROM base as test
ARG PYTHON_VERSION=3.10
RUN if [ $PYTHON_VERSION != 3.7 ] \
;then \
poetry run \
pre-commit run \
-a --show-diff-on-failure \
;fi \
&& poetry run \
pytest \
--ignore venv \
-W ignore::DeprecationWarning \
--cov-report=xml \
--cov=starlette_authlib \
--cov=tests \
--cov-fail-under=100 \
--cov-report=term-missing
FROM base as release
ARG PYPI_TOKEN
ARG CODECOV_TOKEN
ARG GIT_SHA
COPY --from=test /srv/coverage.xml .
RUN set -x \
&& poetry publish --build \
--username __token__ \
--password $PYPI_TOKEN \
&& codecov \
--token $CODECOV_TOKEN \
--commit $GIT_SHA