-
Notifications
You must be signed in to change notification settings - Fork 29
/
Dockerfile
48 lines (43 loc) · 1.28 KB
/
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
48
ARG SDK_ORIGIN=no_sdk
FROM python:3.11-alpine as python_base
RUN apk add --no-cache tk
FROM python_base as python_test_base
RUN mkdir -p /package
COPY / /package
WORKDIR /package
RUN pwd
RUN ls -ltr
ENV PYTHONPATH /package/src
RUN python3 -m pip install pylint
#RUN python3 -m pylint --disable=all ./src
RUN python3 -m pip install coverage
RUN python3 -m pip install -r ./requirements.txt
FROM python_test_base as unit_test
ARG KEY
ARG SECRET
ARG CONDUCTOR_SERVER_URL
ENV KEY=${KEY}
ENV SECRET=${SECRET}
ENV CONDUCTOR_SERVER_URL=${CONDUCTOR_SERVER_URL}
RUN ls -ltr
RUN python3 -m unittest discover --verbose --start-directory=./tests/unit
RUN coverage run --source=./src/conductor/client/orkes -m unittest discover --verbose --start-directory=./tests/integration
RUN coverage report -m
FROM python_test_base as test
ARG KEY
ARG SECRET
ARG CONDUCTOR_SERVER_URL
ENV KEY=${KEY}
ENV SECRET=${SECRET}
ENV CONDUCTOR_SERVER_URL=${CONDUCTOR_SERVER_URL}
RUN python3 ./tests/integration/main.py
FROM python_test_base as publish
WORKDIR /package
RUN ls -ltr
RUN python3 -m pip install setuptools wheel build twine
ARG CONDUCTOR_PYTHON_VERSION
ENV CONDUCTOR_PYTHON_VERSION=${CONDUCTOR_PYTHON_VERSION}
RUN python3 -m build
ARG PYPI_USER
ARG PYPI_PASS
RUN python3 -m twine upload dist/* -u ${PYPI_USER} -p ${PYPI_PASS}