Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker updates #260

Merged
merged 3 commits into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docker/Dockerfile.alpine-latest
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ WORKDIR /src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.debian-bookworm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ WORKDIR /src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.debian-bullseye
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ WORKDIR /src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.debian-trixie
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ WORKDIR /src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile.fedora-39
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN dnf -y update && \
dnf -y upgrade && \
dnf -y install \
python3-clang \
diffutils \
make && \
dnf clean all

Expand All @@ -15,6 +16,7 @@ WORKDIR /src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile.fedora-40
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN dnf -y update && \
dnf -y upgrade && \
dnf -y install \
python3-clang \
diffutils \
make && \
dnf clean all

Expand All @@ -15,6 +16,7 @@ WORKDIR /src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile.fedora-41
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN dnf -y update && \
dnf -y upgrade && \
dnf -y install \
python3-clang \
diffutils \
make && \
dnf clean all

Expand All @@ -15,6 +16,7 @@ WORKDIR /src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile.fedora-rawhide
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ RUN dnf -y update && \
dnf -y upgrade && \
dnf -y install \
python3-clang \
diffutils \
make && \
dnf clean all

Expand All @@ -15,6 +16,7 @@ WORKDIR /src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

Expand Down
1 change: 1 addition & 0 deletions docker/Dockerfile.ubuntu-latest
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ WORKDIR /src

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTEST_ADDOPTS "-p no:cacheprovider"

ADD ${ARCHIVE} .

Expand Down
14 changes: 12 additions & 2 deletions docker/Makefile.local
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,17 @@ docker_dir := docker
HAWKMOTH_VERSION := $(shell cat src/hawkmoth/VERSION)
HAWKMOTH_ARCHIVE := $(docker_dir)/hawkmoth-$(HAWKMOTH_VERSION).tar.gz

INSIDE_WORK_TREE := $(shell git rev-parse --is-inside-work-tree 2>/dev/null)

ifeq ($(INSIDE_WORK_TREE),true)
$(HAWKMOTH_ARCHIVE): $(shell git ls-files)
@test -z "$(shell git status --porcelain --untracked-files=no)" || \
(echo "error: git working directory is not clean" && false)
(echo "error: git work tree is not clean" && false)
git archive -o $@ HEAD
else
$(HAWKMOTH_ARCHIVE): FORCE
@echo "error: git not available or not inside a git work tree" && false
endif

# Containers for local testing
DOCKER_TEST_OUT_MOUNT = --mount type=bind,src=$(PWD)/doc/_build,dst=/out
Expand All @@ -21,12 +28,15 @@ hawkmoth-test.%: $(HAWKMOTH_ARCHIVE) FORCE
docker-test.%: hawkmoth-test.% FORCE
docker run $< make test

docker-check.%: hawkmoth-test.% FORCE
docker run $< make check

docker-html.%: hawkmoth-test.% FORCE
mkdir -p doc/_build
docker run $(DOCKER_TEST_OUT_MOUNT) $< make BUILDDIR=/out html

# Generate targets for auto-completion
$(shell find $(docker_dir) -name 'Dockerfile.*' | sed 's/.*\.\(.*\)/docker-test.\1 docker-html.\1/'):
$(shell find $(docker_dir) -name 'Dockerfile.*' | sed 's/.*\.\(.*\)/docker-test.\1 docker-check.\1 docker-html.\1/'):

FORCE:

Expand Down
Loading