Skip to content

Commit 6aa8a5a

Browse files
authored
set version for the docker build (#574)
1 parent 8ed2f60 commit 6aa8a5a

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

.github/workflows/quay-publish.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ jobs:
1313
id: image_tags
1414
run: |
1515
echo -n ::set-output name=IMAGE_TAGS::${GITHUB_REF#refs/*/}
16+
- name: record schema-salad version
17+
run: pip install setuptools_scm[toml] && python -m setuptools_scm
1618
- name: Set up Docker Buildx
1719
uses: docker/setup-buildx-action@v2
1820
- name: Login to Quay.io

schema_salad.Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
FROM python:3.9-alpine as builder
1+
FROM alpine:latest as builder
22

33
RUN apk add --no-cache git gcc python3-dev libc-dev
4-
54
WORKDIR /schema_salad
65
COPY . .
76

8-
RUN pip install toml -rmypy-requirements.txt "$(grep ruamel requirements.txt)"
9-
RUN SCHEMA_SALAD_USE_MYPYC=1 MYPYPATH=mypy-stubs python3 setup.py bdist_wheel --dist-dir=/wheels
10-
RUN pip wheel -r requirements.txt --wheel-dir=/wheels
11-
RUN pip install --force-reinstall --no-index --no-warn-script-location --root=/pythonroot/ /wheels/*.whl
7+
RUN python3 -m venv env3
8+
RUN source env3/bin/activate && python3 -m pip install -U pip setuptools wheel build
9+
RUN export SETUPTOOLS_SCM_PRETEND_VERSION=$(grep __version__ schema_salad/_version.py | awk -F\' '{ print $2 }') ; source env3/bin/activate && SCHEMA_SALAD_USE_MYPYC=1 MYPYPATH=mypy-stubs python3 -m build --wheel --outdir=/wheels
10+
RUN source env3/bin/activate && python3 -m pip wheel -r requirements.txt --wheel-dir=/wheels
11+
RUN source env3/bin/activate && python3 -m pip install --force-reinstall --no-index --no-warn-script-location --root=/pythonroot/ /wheels/*.whl
1212

13-
FROM python:3.9-alpine as module
13+
FROM alpine:latest as module
1414
LABEL maintainer [email protected]
1515

16+
RUN apk add --no-cache py3-six
17+
1618
COPY --from=builder /pythonroot/ /

0 commit comments

Comments
 (0)