From 458f2037bf4f8082d947ea67854d27fd05cff902 Mon Sep 17 00:00:00 2001 From: Jason Madigan Date: Thu, 5 Dec 2024 16:42:03 +0000 Subject: [PATCH] mike docker commands: mount git config Signed-off-by: Jason Madigan --- README.md | 54 +++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 45 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 32ce00bf..bab5207a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,11 @@ This repository contains documentation for Kuadrant, built using MkDocs and the To run the docs using Docker, mount the current directory to the container and bind it to port `8000`: ```bash -docker run -v "$(pwd):/docs" -p 8000:8000 quay.io/kuadrant/docs.kuadrant.io:latest "mkdocs serve -s -a 0.0.0.0:8000" +docker run \ + -v "$(pwd):/docs" \ + -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" \ + -p 8000:8000 quay.io/kuadrant/docs.kuadrant.io:latest \ + "mkdocs serve -s -a 0.0.0.0:8000" ``` This will serve the docs at [http://localhost:8000](http://localhost:8000). @@ -57,7 +61,11 @@ mike serve Or, with Docker / Podman: ```bash -docker run -v "$(pwd):/docs" -p 8000:8000 quay.io/kuadrant/docs.kuadrant.io:latest "mike serve -a 0.0.0.0:8000" +docker run \ + -v "$(pwd):/docs" \ + -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" \ + -p 8000:8000 quay.io/kuadrant/docs.kuadrant.io:latest \ + "mike serve -a 0.0.0.0:8000" ``` This will serve the docs from the `gh-pages` branch with multi-versioning. For general development, use `mkdocs serve`. @@ -87,7 +95,11 @@ mike list Docker / Podman: ```bash -docker run -v "$(pwd):/docs" quay.io/kuadrant/docs.kuadrant.io:latest "mike list" +docker run \ + -v "$(pwd):/docs" \ + -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" \ + quay.io/kuadrant/docs.kuadrant.io:latest \ + "mike list" ``` #### Deploy a new release with a custom title @@ -101,7 +113,11 @@ mike deploy 0.7.0 -t "0.7.0 (dev)" Docker / Podman: ```bash -docker run -v "$(pwd):/docs" quay.io/kuadrant/docs.kuadrant.io:latest "mike deploy 0.7.0 -t '0.7.0 (dev)'" +docker run \ + -v "$(pwd):/docs" \ + -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" \ + quay.io/kuadrant/docs.kuadrant.io:latest \ + "mike deploy 0.7.0 -t '0.7.0 (dev)'" ``` #### Delete a release @@ -115,7 +131,11 @@ mike delete 0.7.0 Docker / Podman: ```bash -docker run -v "$(pwd):/docs" quay.io/kuadrant/docs.kuadrant.io:latest "mike delete 0.7.0" +docker run \ + -v "$(pwd):/docs" \ + -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" \ + quay.io/kuadrant/docs.kuadrant.io:latest \ + "mike delete 0.7.0" ``` #### Serve multi-versioned docs @@ -129,7 +149,11 @@ mike serve -S Docker / Podman: ```bash -docker run -v "$(pwd):/docs" -p 8000:8000 quay.io/kuadrant/docs.kuadrant.io:latest "mike serve -a 0.0.0.0:8000" +docker run \ + -v "$(pwd):/docs" \ + -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" \ + -p 8000:8000 quay.io/kuadrant/docs.kuadrant.io:latest \ + "mike serve -a 0.0.0.0:8000" ``` --- @@ -178,7 +202,11 @@ mike deploy --update-aliases 0.7.0 latest Docker / Podman: ```bash -docker run -v "$(pwd):/docs" quay.io/kuadrant/docs.kuadrant.io:latest "mike deploy --update-aliases 0.7.0 latest" +docker run \ + -v "$(pwd):/docs" \ + -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" \ + quay.io/kuadrant/docs.kuadrant.io:latest \ + "mike deploy --update-aliases 0.7.0 latest --push" ``` 4. Set this release as the default version: @@ -192,7 +220,11 @@ mike set-default 0.7.0 Docker / Podman: ```bash -docker run -v "$(pwd):/docs" quay.io/kuadrant/docs.kuadrant.io:latest "mike set-default 0.7.0" +docker run \ + -v "$(pwd):/docs" \ + -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" \ + quay.io/kuadrant/docs.kuadrant.io:latest \ + "mike set-default 0.7.0" ``` 5. Tag the repo (e.g., `git tag 0.7.0 && git push --tags `). @@ -230,7 +262,11 @@ mike deploy 0.7.0 -t "0.7.0" --push Docker / Podman: ```bash -docker run -v "$(pwd):/docs" quay.io/kuadrant/docs.kuadrant.io:latest "mike deploy 0.7.0 -t '0.7.0' --push" +docker run \ + -v "$(pwd):/docs" \ + -v "$HOME/.gitconfig:/opt/app-root/src/.gitconfig:ro" \ + quay.io/kuadrant/docs.kuadrant.io:latest \ + "mike deploy 0.7.0 -t '0.7.0' --push" ``` 4. If there’s a push error, reset to the latest `gh-pages` branch and try again.