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

backport: fix: ci: Fix dirty git state when building docker images #10127

Merged
merged 4 commits into from
Jan 26, 2023
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
4 changes: 4 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ jobs:
steps:
- setup_remote_docker
- checkout
- git_fetch_all_tags
- run: git submodule sync
- run: git submodule update --init

- docker/check:
docker-username: DOCKERHUB_USERNAME
docker-password: DOCKERHUB_PASSWORD
Expand Down
4 changes: 4 additions & 0 deletions .circleci/template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,10 @@ jobs:
steps:
- setup_remote_docker
- checkout
- git_fetch_all_tags
- run: git submodule sync
- run: git submodule update --init

- docker/check:
docker-username: DOCKERHUB_USERNAME
docker-password: DOCKERHUB_PASSWORD
Expand Down
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
/AppDir
/appimage-builder-cache
*.AppImage
/lotus
/lotus-miner
/lotus-worker
Expand Down Expand Up @@ -50,3 +47,8 @@ build/builtin-actors/v*
build/builtin-actors/*.car

dist/


# The following files are checked into git and result
# in dirty git state if removed from the docker context
!extern/filecoin-ffi/rust/filecoin.pc
1 change: 0 additions & 1 deletion AppDir/usr/share/icons/icon.svg

This file was deleted.

71 changes: 0 additions & 71 deletions AppImageBuilder.yml

This file was deleted.

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

1 change: 0 additions & 1 deletion snap/local/icon.svg

This file was deleted.

96 changes: 0 additions & 96 deletions snap/snapcraft.yaml

This file was deleted.