Add this as a submodule to your project:
git submodule add https://github.com/adfinis-sygroup/pyproject
Contains common files, like
- Makefile
- A template for setup.py
It expects that you are using virtualenv and/or pyenv.
Create the following Makefile in your project:
PROJECT := [project-package-dir]
GIT_HUB := https://[github-or-gitlab-url]
include pyproject/Makefile
test_ext:
echo Execute custom tests
my_custom_pytest: .deps/pytest
py.test .....
- If you need defined dependencies for tests add them to test_dep, like so:
test_dep: .deps/jinja2 my_custom_cextension
- If you need additional dependencies for tests add them to .requirments.txt in the project.
Standard docker tasks
include pyproject/docker.mk
clean-containers Remove old docker containers
clean-docker Remove all docker containers and dangling images
clean-image Remove the working docker image
docker-run Run default command in docker
image Build the image
root-shell Open a root-shell in container
shell Open a shell in a container
Define the following variables
DOCKER_DIR := docker
IMAGE_NAME := myproject
DEFAULT_CMD := cd /host && make test
Create DOCKER_DIR/Dockerfile
Execute hid.sh in your Dockerfile. It should work for Redhat and Debian. If it doesn't work do the equivalent of hid.sh.
hid.sh is a helper to create the current user inside the container, so the commands don't run as root.
FROM debian:jessie
ADD * /install/
RUN /install/hid.sh