jimporter / mike

Manage multiple versions of your MkDocs-powered documentation via Git
BSD 3-Clause "New" or "Revised" License
528 stars 47 forks source link

Old Versions of Docs reapplied after delete #137

Closed jeepMan79 closed 1 year ago

jeepMan79 commented 1 year ago

Hi,

I'm sure I'm doing something wrong, but when I delete a version or all versions of the docs, they still come back after I rebuild....

  1. mike delete --rebase --all -f -p

From CI

   - git fetch origin $PAGES_BRANCH --depth=1 && git checkout -b $PAGES_BRANCH origin/$PAGES_BRANCH || echo "Pages branch not deployed yet."
    - git checkout $CI_COMMIT_SHA
    - mike deploy --prefix public -r $HTTPS_REMOTE -f -p -b $PAGES_BRANCH 8.1.0
    - mike set-default --prefix public -r $HTTPS_REMOTE -f -p -b $PAGES_BRANCH 8.1.0
    - git checkout $PAGES_BRANCH -- public/

Again, I'm probably doing something wrong :)

jimporter commented 1 year ago

Can you provide a link to the repository and the commits/CI jobs where this is occurring?

jeepMan79 commented 1 year ago

It’s a private gitlab instance for work

jimporter commented 1 year ago

Unfortunately, it'll be pretty difficult for me to diagnose this without seeing the commits/logs, but here are some things for you to take a look at:

  1. I'm suspicious of your mike delete invocation; any time you're using -f (or --rebase for that matter), it's a sign that your local clone isn't up-to-date with upstream. Rather than adding those to make any errors go away, instead, make sure that the command works without them.
  2. Related to the above, check the diff produced by mike delete; does the diff look right (i.e. are all the expected files actually deleted)?
  3. In your commands, you're using git fetch origin, but -r $HTTPS_REMOTE later on; these should probably be the same.