Skip to content

Commit dbead68

Browse files
karolyczoveklae
andauthored
Generate offline documentation during deployment (#142)
Co-authored-by: Musee Ullah <lae@lae.is>
1 parent 5d0e0f7 commit dbead68

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

tasks/deploy_netbox.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,14 @@
161161
- netbox_stable and netbox_stable_version is version('2.10.0', '>=')
162162
or netbox_git and _netbox_git_contains_trace_paths.rc == 0
163163

164+
- name: Build the local documentation
165+
shell:
166+
cmd: "{{ netbox_virtualenv_path }}/bin/mkdocs build"
167+
chdir: "{{ netbox_current_path }}"
168+
when:
169+
- netbox_stable and netbox_stable_version is version('3.0.0', '>=')
170+
or netbox_git and _netbox_git_contains_mkdocs.rc == 0
171+
164172
- name: Create a super user for NetBox
165173
shell: "printf '{{ netbox_superuser_script }}' |\
166174
{{ netbox_virtualenv_path }}/bin/python {{ netbox_current_path }}/netbox/manage.py shell"

tasks/install_via_git.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,15 @@
5151
changed_when: False
5252
failed_when: "_netbox_git_contains_trace_paths.rc not in [0, 1]"
5353

54+
- name: Check existence of commit e165dca, introducing mkdocs command during update
55+
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^7058d6ca5ae2901383874bcea5fedad31e165dca'
56+
args:
57+
chdir: "{{ netbox_git_repo_path }}"
58+
executable: /bin/bash
59+
register: _netbox_git_contains_mkdocs
60+
changed_when: False
61+
failed_when: "_netbox_git_contains_mkdocs.rc not in [0, 1]"
62+
5463
- name: Check existence of commit d87ec82, introducing nightly housekeeping command
5564
shell: 'set -o pipefail; git log --format=%H "{{ netbox_git_version }}" | grep ^d87ec82fe34d92a84ee6f2a97ba0a87a53eed015'
5665
args:

0 commit comments

Comments
 (0)