File tree Expand file tree Collapse file tree 3 files changed +24
-10
lines changed
Expand file tree Collapse file tree 3 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,14 @@ jobs:
1111 - 3.8
1212 steps :
1313 - uses : actions/checkout@v1
14+ - uses : actions/setup-python@v1
15+ with :
16+ python-version : ${{ matrix.python }}
1417 - uses : docker/login-action@v1
1518 with :
1619 username : ${{ secrets.DOCKERHUB_USERNAME }}
1720 password : ${{ secrets.DOCKERHUB_TOKEN }}
18- - run : PYTHON_VERSION=${{ matrix.python }} docker-compose build
19- - run : docker-compose push
20- if : ${{ github.event_name == 'tag' }}
21+ - run : pip install . flake8 pytest pytest-cov
22+ - run : make images
23+ - run : make push
24+ if : ${{ github.event_name == 'tags' }}
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ ENV PYTHONPATH=/opt/python:/var/task
44EXPOSE 8000
55VOLUME /var/task
66VOLUME /opt/python
7- COPY dist .
8- RUN pip install *.tar.gz && rm *.tar.gz
7+ ARG TARBALL=lambda-gateway-latest.tar.gz
8+ COPY ${TARBALL} ${TARBALL}
9+ RUN pip install ${TARBALL} && rm ${TARBALL}
910ENTRYPOINT [ "python" , "-m" , "lambda_gateway" ]
Original file line number Diff line number Diff line change @@ -3,13 +3,18 @@ SDIST := dist/$(shell python setup.py --fullname).tar.gz
33SLEEP := 0
44TIMEOUT := 3
55
6- .PHONY : all clean test up upload
6+ .PHONY : all clean images push test up upload
77
8- all : Dockerfile.3.8.iid Dockerfile.3.7.iid
8+ all : dist/lambda-gateway-latest.tar.gz
99
1010clean :
1111 rm -rf dist * .iid coverage.xml
1212
13+ images : Dockerfile.3.7.iid Dockerfile.3.8.iid
14+
15+ push : Dockerfile.3.7.iid Dockerfile.3.8.iid
16+ docker push --all-tags $(REPO )
17+
1318test : coverage.xml
1419
1520up :
1823upload : $(SDIST )
1924 twine upload $<
2025
21- Dockerfile.% .iid : $( SDIST ) Dockerfile
26+ Dockerfile.% .iid : dist/lambda-gateway-latest.tar.gz Dockerfile
2227 docker build \
2328 --build-arg PYTHON_VERSION=$* \
29+ --build-arg TARBALL=$< \
2430 --iidfile $@ \
2531 --tag $(REPO ) :$* \
2632 .
2733
28- $(SDIST ) : coverage.xml
29- python setup.py sdist
34+ dist/lambda-gateway-latest.tar.gz : $(SDIST )
35+ cp $< $@
36+
37+ dist/lambda-gateway-% .tar.gz : coverage.xml
38+ SETUPTOOLS_SCM_PRETEND_VERSION=$* python setup.py sdist
3039
3140coverage.xml : $(shell find lambda_gateway tests -name '* .py')
3241 flake8 $^
You can’t perform that action at this time.
0 commit comments