-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from apiad/develop
Develop
- Loading branch information
Showing
6 changed files
with
102 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
version: "3" | ||
|
||
services: | ||
auditorium: | ||
image: docker.pkg.github.com/apiad/auditorium/auditorium:latest | ||
build: "." | ||
volumes: | ||
- "./:/code" | ||
network_mode: host | ||
command: auditorium demo | ||
working_dir: "/" | ||
auditorium-tester: | ||
container_name: auditorium-tester-${PYTHON_VERSION} | ||
image: docker.pkg.github.com/apiad/auditorium/auditorium:${PYTHON_VERSION} | ||
build: | ||
context: "." | ||
args: | ||
PYTHON_VERSION: ${PYTHON_VERSION} | ||
volumes: | ||
- "./:/code" | ||
command: make dev-test-full |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,27 @@ | ||
FROM python:3.6 | ||
# ===================== | ||
# Generic build system | ||
# --------------------- | ||
|
||
ARG PYTHON_VERSION | ||
|
||
FROM python:${PYTHON_VERSION} | ||
|
||
RUN echo Building image for Python:${PYTHON_VERSION} | ||
|
||
# ========================================== | ||
# Project-specific installation instruction | ||
# ------------------------------------------ | ||
|
||
WORKDIR /code | ||
COPY pyproject.toml poetry.lock makefile /code/ | ||
|
||
ENV XDG_CACHE_HOME="/opt/venv/cache" | ||
ENV POETRY_VIRTUALENVS_PATH="/opt/venv" | ||
ENV BUILD_ENVIRONMENT="development" | ||
ENV XDG_CACHE_HOME="/opt/dev/cache" | ||
|
||
RUN make install-bare | ||
# Use system's Python for installing dev tools | ||
RUN make dev-install | ||
|
||
COPY . /code | ||
|
||
RUN poetry install | ||
RUN make test | ||
|
||
VOLUME [ "/opt/venv" ] | ||
CMD bash | ||
VOLUME [ "/opt/dev" ] | ||
CMD [ "bash" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,57 @@ | ||
.PHONY: build clean install test lint cov | ||
.PHONY: clean lint test-fast test-full shell | ||
|
||
# TODO: Update your project folder | ||
PROJECT=auditorium | ||
BASE_VERSION := 3.8 | ||
ALL_VERSIONS := 3.6 3.7 3.8 | ||
|
||
test-fast: | ||
PYTHON_VERSION=${BASE_VERSION} docker-compose run auditorium-tester make dev-test-fast | ||
|
||
shell: | ||
PYTHON_VERSION=${BASE_VERSION} docker-compose run auditorium-tester bash | ||
|
||
build: | ||
poetry build | ||
PYTHON_VERSION=${BASE_VERSION} docker-compose run auditorium-tester make dev-build | ||
|
||
clean: | ||
git clean -fxd | ||
|
||
install-base: | ||
pip install -U pip | ||
pip install poetry | ||
lint: | ||
PYTHON_VERSION=${BASE_VERSION} docker-compose run auditorium-tester poetry run pylint auditorium | ||
|
||
install-bare: install-base | ||
poetry config virtualenvs.create false | ||
poetry install | ||
test-full: | ||
$(foreach VERSION, $(ALL_VERSIONS), PYTHON_VERSION=${VERSION} docker-compose up;) | ||
|
||
docker-build: | ||
$(foreach VERSION, $(ALL_VERSIONS), PYTHON_VERSION=${VERSION} docker-compose build;) | ||
|
||
docker-push: | ||
$(foreach VERSION, $(ALL_VERSIONS), PYTHON_VERSION=${VERSION} docker-compose push;) | ||
|
||
install: install-base | ||
# Below are the commands that will be run INSIDE the development environment, i.e., inside Docker or Travis | ||
# These commands are NOT supposed to be run by the developer directly, and will fail to do so. | ||
|
||
.PHONY: dev-ensure dev-build dev-install dev-test-fast dev-test-full dev-cov | ||
|
||
dev-ensure: | ||
# Check if you are inside a development environment | ||
echo ${BUILD_ENVIRONMENT} | grep "development" >> /dev/null | ||
|
||
dev-build: dev-ensure | ||
poetry build | ||
|
||
dev-install: dev-ensure | ||
pip install poetry | ||
poetry config virtualenvs.create false | ||
poetry install | ||
|
||
test: | ||
poetry run auditorium test && \ | ||
poetry run mypy -p auditorium --ignore-missing-imports && \ | ||
poetry run pytest --doctest-modules --cov=$(PROJECT) --cov-report=xml -v | ||
dev-test-fast: dev-ensure | ||
python -m mypy -p auditorium --ignore-missing-imports | ||
python -m pytest --doctest-modules --cov=auditorium --cov-report=term-missing -v | ||
|
||
lint: | ||
poetry run pylint $(PROJECT) | ||
dev-test-full: dev-ensure | ||
python -m auditorium test | ||
python -m mypy -p auditorium --ignore-missing-imports | ||
python -m pytest --doctest-modules --cov=auditorium --cov-report=xml | ||
|
||
cov: | ||
poetry run codecov | ||
dev-cov: dev-ensure | ||
python -m codecov |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters