Skip to content

Commit

Permalink
Check git state in Dockerfile to catch .dockerignore bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
ianconsolata committed Jan 26, 2023
1 parent 17d2205 commit 0f6003f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ RUN set -eux; \
COPY ./ /opt/filecoin
WORKDIR /opt/filecoin

RUN scripts/docker-git-state-check.sh

### make configurable filecoin-ffi build
ARG FFI_BUILD_FROM_SOURCE=0
ENV FFI_BUILD_FROM_SOURCE=${FFI_BUILD_FROM_SOURCE}
Expand Down
12 changes: 12 additions & 0 deletions scripts/docker-git-state-check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set -e

if [ -z "$(git status --porcelain)" ]; then
echo "PASSED: Working directory clean"
else
echo "FAILED: Working directory not clean."
echo "This is likely because the .dockerignore file has removed something checked into git."
echo "Add the missing files listed below to the .dockerignore to fix this issue:"
echo "$(git status)"
exit 1
fi

0 comments on commit 0f6003f

Please sign in to comment.