File tree 3 files changed +24
-10
lines changed
3 files changed +24
-10
lines changed Original file line number Diff line number Diff line change @@ -11,10 +11,14 @@ jobs:
11
11
- 3.8
12
12
steps :
13
13
- uses : actions/checkout@v1
14
+ - uses : actions/setup-python@v1
15
+ with :
16
+ python-version : ${{ matrix.python }}
14
17
- uses : docker/login-action@v1
15
18
with :
16
19
username : ${{ secrets.DOCKERHUB_USERNAME }}
17
20
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
4
4
EXPOSE 8000
5
5
VOLUME /var/task
6
6
VOLUME /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}
9
10
ENTRYPOINT [ "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
3
3
SLEEP := 0
4
4
TIMEOUT := 3
5
5
6
- .PHONY : all clean test up upload
6
+ .PHONY : all clean images push test up upload
7
7
8
- all : Dockerfile.3.8.iid Dockerfile.3.7.iid
8
+ all : dist/lambda-gateway-latest.tar.gz
9
9
10
10
clean :
11
11
rm -rf dist * .iid coverage.xml
12
12
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
+
13
18
test : coverage.xml
14
19
15
20
up :
18
23
upload : $(SDIST )
19
24
twine upload $<
20
25
21
- Dockerfile.% .iid : $( SDIST ) Dockerfile
26
+ Dockerfile.% .iid : dist/lambda-gateway-latest.tar.gz Dockerfile
22
27
docker build \
23
28
--build-arg PYTHON_VERSION=$* \
29
+ --build-arg TARBALL=$< \
24
30
--iidfile $@ \
25
31
--tag $(REPO ) :$* \
26
32
.
27
33
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
30
39
31
40
coverage.xml : $(shell find lambda_gateway tests -name '* .py')
32
41
flake8 $^
You can’t perform that action at this time.
0 commit comments