forked from swift-conductor/conductor-client-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
42 lines (34 loc) · 1.15 KB
/
Dockerfile
File metadata and controls
42 lines (34 loc) · 1.15 KB
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
ARG SDK_ORIGIN=local_sdk
FROM python:3.11-alpine as python_base
RUN apk add --no-cache tk
RUN mkdir /package
COPY /src /package/src
COPY /setup* /package/
COPY /README.md /package/
WORKDIR /package
FROM python_base as lint
RUN python3 -m pip install pylint
RUN python3 -m pylint --disable=all ./src
FROM python_base as local_sdk
ENV CONDUCTOR_PYTHON_VERSION="v0.0.0"
RUN python3 -m pip install .
FROM python_base as remote_sdk
ARG CONDUCTOR_PYTHON_VERSION
RUN python3 -m pip install conductor-client-python==${CONDUCTOR_PYTHON_VERSION}
FROM ${SDK_ORIGIN} as python_test_base
RUN rm -rf /package/src
COPY /tests /package/tests
FROM python_test_base as unit_test
RUN python3 -m unittest discover --verbose --start-directory=./tests/unit
FROM python_test_base as test
ARG CONDUCTOR_SERVER_URL
ENV CONDUCTOR_SERVER_URL=${CONDUCTOR_SERVER_URL}
RUN python3 /package/tests/integration/main.py
FROM python_base as publish
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}