From 800022e588a180fa43671e54a0633f0d4b84c046 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Tue, 22 Oct 2024 23:48:52 -0400 Subject: [PATCH 1/2] added info for docker --- docs/hero_mdbook_docker.md | 14 +++++++++++--- docs/mdbook_basics.md | 6 ++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/docs/hero_mdbook_docker.md b/docs/hero_mdbook_docker.md index 490b018..e471cf3 100644 --- a/docs/hero_mdbook_docker.md +++ b/docs/hero_mdbook_docker.md @@ -16,7 +16,7 @@ You can then use a code editor, e.g. VSCodium, to change the files locally and u ## Prerequisites -- [Docker engine](https://docs.docker.com/engine/install/ubuntu/) should be installed and running on Linux +- [Docker Engine](https://docs.docker.com/engine/install/ubuntu/) should be installed and running on Linux - [Docker Desktop](https://www.docker.com/products/docker-desktop/) should be installed and running on MacOS and Windows - You need a git repository to work with (here we use **info_tfgrid**) - Clone the hero mdbook repo on your local machine (i.e. the host) and note the path @@ -31,9 +31,13 @@ Once you've set Hero Docker, you can adjust the files at the host path in a code Note that you will need to adjust the local path of the git repo and the docker path of the git repo. -- On a terminal window, start Hero docker +- On a terminal window, create the code repository on the local machine ``` - sudo docker run --name herodocker -d -v /local/machine/path/to/git/repo:/docker/path/to/git/repo/ ghcr.io/scottyeager/hero:latest + mkdir -p ~/code/git.ourworld.tf/tfgrid + ``` +- Start Hero docker + ``` + sudo docker run --net=host --name herodocker -d -v ~/code/git.ourworld.tf/tfgrid:~/code/git.ourworld.tf/tfgrid ghcr.io/scottyeager/hero:latest ``` - In our case, the docker path to the repo is the following ``` @@ -43,6 +47,10 @@ Note that you will need to adjust the local path of the git repo and the docker ``` sudo docker exec -it herodocker bash ``` +- Change directory + ``` + cd ~/code/git.ourworld.tf/tfgrid + ``` - Git configuration - Set git lobally with a safe directory ``` diff --git a/docs/mdbook_basics.md b/docs/mdbook_basics.md index 89f565e..28435af 100644 --- a/docs/mdbook_basics.md +++ b/docs/mdbook_basics.md @@ -80,7 +80,5 @@ choco install mdbook - Update an mdbook on a GitHub repo - https://manual.grid.tf/knowledge_base/collaboration/contribute.html -- Deploy a Hero Mdbook on Docker - - https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/development/docs/hero_mdbook_docker.md -- Create a Hero Mdbook - - https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/development/docs/hero_create_mdbook.md \ No newline at end of file +- [Deploy a Hero Mdbook on Docker](./hero_mdbook_docker.md) +- [Create a Hero Mdbook](./hero_create_mdbook.md) \ No newline at end of file From c6d20f36d7d335f8a59f8cd859310b535f83d238 Mon Sep 17 00:00:00 2001 From: mik-tf Date: Tue, 22 Oct 2024 23:51:12 -0400 Subject: [PATCH 2/2] added info for docker --- docs/hero_mdbook_docker.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/docs/hero_mdbook_docker.md b/docs/hero_mdbook_docker.md index e471cf3..deeef72 100644 --- a/docs/hero_mdbook_docker.md +++ b/docs/hero_mdbook_docker.md @@ -34,6 +34,8 @@ Note that you will need to adjust the local path of the git repo and the docker - On a terminal window, create the code repository on the local machine ``` mkdir -p ~/code/git.ourworld.tf/tfgrid + cd ~/code/git.ourworld.tf/tfgrid + git clone https://git.ourworld.tf/tfgrid/info_tfgrid ``` - Start Hero docker ``` @@ -49,26 +51,26 @@ Note that you will need to adjust the local path of the git repo and the docker ``` - Change directory ``` - cd ~/code/git.ourworld.tf/tfgrid + cd ~/code/git.ourworld.tf/tfgrid/info_tfgrid ``` - Git configuration - Set git lobally with a safe directory ``` git config --global --add safe.directory /root/code/git.ourworld.tf/tfgrid/info_tfgrid ``` -- You can now use Hero normally, e.g. with **projectinca** +- You can now use Hero normally, e.g. with **tech** - With a URL: ``` - hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript/projectinca + hero mdbook -u https://git.ourworld.tf/tfgrid/info_tfgrid/src/branch/main/heroscript/tech ``` - With a path: ``` - hero mdbook -p /root/code/git.ourworld.tf/tfgrid/info_tfgrid/heroscript/projectinca + hero mdbook -p /root/code/git.ourworld.tf/tfgrid/info_tfgrid/heroscript/tech ``` - In this case, you can modify the mdbook on the local machine's git repo that you set in the prerequisites section and the changes will be shown on the docker path - To view the mdbook on your local browser, run the lines: ``` - cd ~/hero/var/mdbuild/projectinca/ + cd ~/hero/var/mdbuild/tech/ mdbook serve -n 0.0.0.0 ``` - You should be able to view the rendered book at