Skip to content

Commit

Permalink
Fix docs build for ltm-1.6 (#102)
Browse files Browse the repository at this point in the history
* Fix RTD docs builds

* Fix dependency compatibility with mkdocs

* fix docker compose command

---------

Co-authored-by: Gary Snider <[email protected]>
  • Loading branch information
cmsirbu and gsnider2195 authored Oct 16, 2024
1 parent 7ae5984 commit df8bc74
Show file tree
Hide file tree
Showing 4 changed files with 83 additions and 25 deletions.
22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python in the build environment.
build:
os: "ubuntu-22.04"
tools:
python: "3.10"

mkdocs:
configuration: "mkdocs.yml"
fail_on_warning: false

# Use our docs/requirements.txt during installation.
python:
install:
- requirements: "docs/requirements.txt"
4 changes: 2 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mkdocs==1.3.0
markdown-include==0.6.0
mkdocs==1.6.1
markdown-include==0.8.1
74 changes: 55 additions & 19 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,23 +74,23 @@ def task_wrapper(function=None):


def docker_compose(context, command, **kwargs):
"""Helper function for running a specific docker-compose command with all appropriate parameters and environment.
"""Helper function for running a specific docker compose command with all appropriate parameters and environment.
Args:
context (obj): Used to run specific commands
command (str): Command string to append to the "docker-compose ..." command, such as "build", "up", etc.
command (str): Command string to append to the "docker compose ..." command, such as "build", "up", etc.
**kwargs: Passed through to the context.run() call.
"""
build_env = {
"NAUTOBOT_VER": context.nautobot_capacity_metrics.nautobot_ver,
"PYTHON_VER": context.nautobot_capacity_metrics.python_ver,
}
compose_command = f'docker-compose --project-name {context.nautobot_capacity_metrics.project_name} --project-directory "{context.nautobot_capacity_metrics.compose_dir}"'
compose_command = f'docker compose --project-name {context.nautobot_capacity_metrics.project_name} --project-directory "{context.nautobot_capacity_metrics.compose_dir}"'
for compose_file in context.nautobot_capacity_metrics.compose_files:
compose_file_path = os.path.join(context.nautobot_capacity_metrics.compose_dir, compose_file)
compose_command += f' -f "{compose_file_path}"'
compose_command += f" {command}"
print(f'Running docker-compose command "{command}"')
print(f'Running docker compose command "{command}"')
return context.run(compose_command, env=build_env, **kwargs)


Expand Down

0 comments on commit df8bc74

Please sign in to comment.