Skip to content

Commit

Permalink
Site publishing: add checksum computation to gsutil rsync
Browse files Browse the repository at this point in the history
`gsutil rsync` does not compute checksum when one of its
argument is on a local filesystem because this can be slow,
for our use case we want to do it or two files with the same
size will be seen as identical.

--
MOS_MIGRATED_REVID=135903003
  • Loading branch information
damienmg authored and hermione521 committed Oct 12, 2016
1 parent 7bbb395 commit d38ee63
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion scripts/ci/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,10 @@ function build_and_publish_site() {
fi
tar xf "${site}" --exclude=CNAME -C "${tmpdir}"
jekyll build -s "${tmpdir}" -d "${tmpdir}/production"
"${gs}" rsync -r "${tmpdir}/production" "gs://${bucket}"
# Rsync:
# -r: recursive
# -c: compute checksum even though the input is from the filesystem
"${gs}" rsync -r -c "${tmpdir}/production" "gs://${bucket}"
"${gs}" web set -m index.html -e 404.html "gs://${bucket}"
"${gs}" -m acl ch -R -u AllUsers:R "gs://${bucket}"
}

0 comments on commit d38ee63

Please sign in to comment.