Skip to content

Commit

Permalink
Merge pull request #108 from lubosmj/docs-building-2
Browse files Browse the repository at this point in the history
Revert "Revert "Add a section for building docs""
  • Loading branch information
lubosmj authored Jul 12, 2023
2 parents bc42e74 + 0bc11b5 commit 4d0e000
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ jobs:
cp oci_env/.github/assets/${TEST}_compose.env oci_env/compose.env
cp oci_env/.github/assets/${TEST}_compose.env ${PWD}/custom.env
echo "API_PORT=7210" >> ${PWD}/custom.env
echo "DOCS_PORT=12346" >> ${PWD}/custom.env
echo "COMPOSE_PROJECT_NAME=my_2nd_project" >> ${PWD}/custom.env
echo "SECOND_SERVICE_PORT=7002" >> ${PWD}/custom.env
Expand Down
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,19 @@ Please note that `host.containers.internal` points to the wrong interface in `po
using `podman` < 4.1, you need modify `/etc/hosts` inside the container running Pulp with the IP
address for the publicly facing network interface on the host.
#### Building docs
First, navigate to `/src/{plugin}/docs` in the container and do the following:
```
pip3 install -r ../doc_requirements.txt
make clean && make diagrams && make html
python3 -m http.server ${DOCS_PORT}
```
Then, visit `0.0.0.0:${DOCS_PORT}` in a web browser to preview the documentation.
### Unit
```bash
Expand Down
3 changes: 3 additions & 0 deletions base/compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ services:
- "API_HOST={API_HOST}"
- "API_PORT={API_PORT}"
- "API_PROTOCOL={API_PROTOCOL}"
- "DOCS_PORT={DOCS_PORT}"
- "NGINX_DOCS_PORT={NGINX_DOCS_PORT}"
- "REMOTE_FIXTURES_ORIGIN={REMOTE_FIXTURES_ORIGIN}"
- "NGINX_PORT={NGINX_PORT}"
- "NGINX_SSL_PORT={NGINX_SSL_PORT}"
Expand All @@ -31,6 +33,7 @@ services:

ports:
- "{API_PORT}:{NGINX_PORT}"
- "{DOCS_PORT}:{NGINX_DOCS_PORT}"
depends_on:
- _base
volumes:
Expand Down
4 changes: 4 additions & 0 deletions client/oci_env/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ def get_config(env_file):
"API_PROTOCOL": "http",
"API_HOST": "localhost",
"API_PORT": "5001",

# A port dedicated for exposing generated docs
"DOCS_PORT": "12345",
"NGINX_DOCS_PORT": user_preferences.get("DOCS_PORT", "12345"),

# nginx port to run in the container. This defaults to 5001 if nothing is set or
# the value of API_HOST if that is set.
Expand Down
3 changes: 2 additions & 1 deletion compose.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ DEV_SOURCE_PATH=
# Port, hostname and protocol used to configure pulp content origin
# API_HOST=localhost
# API_PORT=5001
# API_PROTOCOL=http
# API_PROTOCOL=http
# DOCS_PORT=12345

0 comments on commit 4d0e000

Please sign in to comment.