Skip to content

Commit

Permalink
docker: fix stale directory tree with volume mount
Browse files Browse the repository at this point in the history
Some rsync options are actually conflicting options (even though rsync
doesn't say so), which may lead to a stale tree in the case of Docker
volume mounts if the Docker image is generated after the modifications
in the mounted tree.
  • Loading branch information
dev-zero committed May 16, 2019
1 parent 3e740b3 commit 932221a
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions tools/docker/scripts/ci_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,17 @@ if [ -n "${GIT_REF}" ]; then

elif [ -d /mnt/cp2k ]; then
echo -e "\n========== Copying Changed Files =========="
rsync --update \
# Don't skip by matching timestamp since Git (previous mirror) does not preserve timestamps
# and we end up with an outdated tree if the contents of /mnt/cp2k have been modified before
# the Docker image was generated.
# Also ignore the checksum since it is safe to assume that most files have not changed (which would
# mean they have the same filesize) which would mean we would do a read+read(+write) on most files
# anyway at which point it is simpler to do a read+write (e.g. replace the whole tree).
rsync --ignore-times \
--delete \
--executability \
--ignore-times \
--verbose \
--recursive \
--checksum \
--exclude="*~" \
--exclude=".*/" \
--exclude="*.py[cod]" \
Expand Down

0 comments on commit 932221a

Please sign in to comment.