ISO clarifying how "deploy" command works

Spun up from a different thread, I am trying the deploy command out. It appears the workflow is:

  1. build the site with hugo
  2. deploy the site with hugo deploy

The way I understand it to work is that the deploy command looks for new/updated/deleted files and only uploads the delta + removes the deleted ones.

So I tried this:

  1. build site with hugo
  2. deploy site with hugo deploy --force --maxDelete -1… everything gets uploaded (at this point, all is working)
  3. update an existing file
  4. build & deploy hugo && hugo deploy --maxDelete -1… I see hugo only uploads one file… perfect!
  5. add a new file
  6. build & deploy hugo && hugo deploy --maxDelete -1… I see hugo only uploads a few files (the new page + a few summary pages where it should appear, sitemap, rss, etc… all expected)… perfect!
  7. delete a file
  8. build & deploy hugo && hugo deploy --maxDelete -1… hugo uploads 3500+ files & 0 deletes… huh?
  9. delete the built folder, then rebuild & deploy rm -rf public && hugo && hugo deploy --maxDelete -1… hugo 2 files & 1 deletes… expected!

In the second to last test (#8), I don’t understand why so many files are uploaded & none are deleted. Does this make sense to someone else?

My builds are in a CI/CD process so each build will always create a clean /public folder like I’m doing in step 9 above, so the outcome is fine, but what’s going on with step 8 above is raising a flag…

The deploy command is implemented by a rocket physicist now working for Google. The implementation is solid, but it’s new. Can you copy and paste the above text into a GitHub issue? I’m guessing a little here, but there may be an error case where the “get the list of files with MD5 hashes from Azure” fails for some reason (network issue?) and it falls back to “upload everything”. Not sure.

2 Likes

Cool… issue submitted: https://github.com/gohugoio/hugo/issues/6183