Skip to content

Commit

Permalink
docker: ensure working directory is clean
Browse files Browse the repository at this point in the history
Using git archive to transfer files to the docker images means
uncommitted modifications aren't transfered. It can be confusing if the
modifications aren't reflected in the results. Fail with a warning
message if the working directory is not clean.
  • Loading branch information
jnikula committed Mar 24, 2024
1 parent 0ac44c8 commit 581a63c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker/Makefile.local
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ HAWKMOTH_VERSION := $(shell cat src/hawkmoth/VERSION)
HAWKMOTH_ARCHIVE := $(docker_dir)/hawkmoth-$(HAWKMOTH_VERSION).tar.gz

$(HAWKMOTH_ARCHIVE): $(shell git ls-files)
@test -z "$(shell git status --porcelain --untracked-files=no)" || \
(echo "error: git working directory is not clean" && false)
git archive -o $@ HEAD

# Containers for local testing
Expand Down

0 comments on commit 581a63c

Please sign in to comment.