Compare commits
No commits in common. "8362590d79078b9b60c3ed6aa40e938e4f387ae4" and "5806c696e3293d0d39231ec50ab09d6ee90336fb" have entirely different histories.
8362590d79
...
5806c696e3
|
|
@ -1,7 +0,0 @@
|
||||||
# Ignore everything
|
|
||||||
*
|
|
||||||
|
|
||||||
# The stuff necessary to build the image
|
|
||||||
!app/
|
|
||||||
!setup.cfg
|
|
||||||
!setup.py
|
|
||||||
|
|
@ -1,21 +1,17 @@
|
||||||
|
matrix:
|
||||||
|
PYTHON_VERSION:
|
||||||
|
- 3.8
|
||||||
|
- 3.9
|
||||||
|
|
||||||
pipeline:
|
pipeline:
|
||||||
test:
|
test:
|
||||||
# Alpine version doesn't have make
|
# Alpine version doesn't have make
|
||||||
image: python:3.8
|
image: python:${PYTHON_VERSION}
|
||||||
pull: true
|
pull: true
|
||||||
commands:
|
commands:
|
||||||
- make test
|
- make test
|
||||||
|
|
||||||
lint:
|
lint:
|
||||||
image: python:3.8
|
image: python:${PYTHON_VERSION}
|
||||||
commands:
|
commands:
|
||||||
- make lint
|
- make lint
|
||||||
|
|
||||||
publish-dev:
|
|
||||||
image: plugins/docker
|
|
||||||
repo: chewingbever/jos
|
|
||||||
tag: [ dev ]
|
|
||||||
secrets: [ docker_username, docker_password ]
|
|
||||||
when:
|
|
||||||
branch: develop
|
|
||||||
event: push
|
|
||||||
|
|
|
||||||
34
Dockerfile
34
Dockerfile
|
|
@ -1,34 +0,0 @@
|
||||||
FROM python:3.9 AS builder
|
|
||||||
|
|
||||||
WORKDIR /wheels
|
|
||||||
|
|
||||||
# Update pip & build the wheels
|
|
||||||
COPY ./setup.cfg ./
|
|
||||||
RUN pip wheel -e .
|
|
||||||
|
|
||||||
|
|
||||||
FROM python:3.9-slim
|
|
||||||
|
|
||||||
# Switch to non-root user
|
|
||||||
RUN groupadd -r runner && \
|
|
||||||
useradd -mrg runner runner
|
|
||||||
|
|
||||||
# Install the generated wheels
|
|
||||||
COPY --from=builder /wheels /wheels
|
|
||||||
RUN pip install \
|
|
||||||
--no-cache-dir \
|
|
||||||
--no-warn-script-location \
|
|
||||||
-f /wheels \
|
|
||||||
-e /wheels && \
|
|
||||||
rm -rf /wheels
|
|
||||||
|
|
||||||
# Switch to non-root user
|
|
||||||
USER runner
|
|
||||||
|
|
||||||
# Copy source files
|
|
||||||
WORKDIR /usr/src/app
|
|
||||||
COPY --chown=runner:runner ./app ./app
|
|
||||||
COPY --chown=runner:runner setup.cfg setup.py ./
|
|
||||||
|
|
||||||
ENTRYPOINT ["python"]
|
|
||||||
CMD ["app"]
|
|
||||||
7
Makefile
7
Makefile
|
|
@ -3,7 +3,7 @@ PYTHON := python3
|
||||||
# This can't contain spaces (I think)
|
# This can't contain spaces (I think)
|
||||||
VENV := .venv
|
VENV := .venv
|
||||||
# Minimum % coverage for tests to succeed
|
# Minimum % coverage for tests to succeed
|
||||||
MIN_COV := 0
|
MIN_COV := 10
|
||||||
|
|
||||||
|
|
||||||
# By default, just create the venv when needed
|
# By default, just create the venv when needed
|
||||||
|
|
@ -49,7 +49,6 @@ clean:
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
||||||
|
|
||||||
## Starting the server
|
# Run the Flask server
|
||||||
### Run the Quart server
|
# TODO
|
||||||
run: venv
|
run: venv
|
||||||
@ '$(VENV)'/bin/python app
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
from quart import Quart
|
|
||||||
|
|
||||||
app = Quart("jos")
|
|
||||||
|
|
||||||
@app.route("/")
|
|
||||||
async def hello():
|
|
||||||
return "hello"
|
|
||||||
|
|
||||||
app.run(host="0.0.0.0")
|
|
||||||
|
|
@ -1,3 +0,0 @@
|
||||||
def test_succeed():
|
|
||||||
"""Placeholder test to make CI succeed."""
|
|
||||||
pass
|
|
||||||
Reference in New Issue