Skip to content

Commit 4730663

Browse files
authored
ci: remove unneeded path tricks in docs workflow (#640)
Removed unnecessary `./ansible_collections/paloaltonetworks/panos` path tricks from CI docs workflow.
1 parent cb8f96a commit 4730663

5 files changed

Lines changed: 20 additions & 37 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ jobs:
9797
run:
9898
working-directory: ./ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
9999
steps:
100+
# Just a note here: The Ansible stuff is apparently doing realpath
101+
# checks, so trying to simlink stuff and then run Ansible commands
102+
# such as ansible-test in the symlink directory fails. Thus we need
103+
# to have the real path contain ansible_collections/paloaltonetworks/panos.
100104
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
101105
with:
102106
path: ./ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}

.github/workflows/docs.yml

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,32 +9,17 @@ env:
99
COLLECTION_NAME: panos
1010

1111
jobs:
12-
pyversion:
13-
name: Discover minimum Python version
14-
uses: ./.github/workflows/_discover_python_ver.yml
15-
1612
docs:
1713
name: Build Documentation
1814
runs-on: ubuntu-latest
19-
defaults:
20-
run:
21-
working-directory: ./ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
2215

2316
steps:
24-
# Just a note here: The Ansible stuff is apparently doing realpath
25-
# checks, so trying to simlink stuff and then run Ansible commands
26-
# such as ansible-test in the symlink directory fails. Thus we need
27-
# to have the real path contain ansible_collections/paloaltonetworks/panos.
2817
- name: Checkout
2918
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
30-
with:
31-
path: ./ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
3219

3320
- name: discover Python version
3421
id: pyversion
3522
uses: ./.github/actions/discover_python_version
36-
with:
37-
working-directory: ./ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
3823

3924
- name: Setup Python
4025
uses: actions/setup-python@b64ffcaf5b410884ad320a9cfac8866006a109aa # v4
@@ -49,9 +34,6 @@ jobs:
4934
- name: Add ansible-core
5035
run: poetry add ansible-core^2.16
5136

52-
- name: Add antsibull-docs
53-
run: poetry add antsibull-docs
54-
5537
- name: Install dependencies
5638
run: poetry install
5739

@@ -69,16 +51,6 @@ jobs:
6951
rm -rf docs/html/.doctrees
7052
shell: bash
7153

72-
# This is here for right now because the action to deploy seems to assume
73-
# (and not have a configuration option to) mirror the actions/checkout@v4
74-
# the with.path spec.
75-
- name: Move the repo to where the deploy action is looking for it
76-
run: |
77-
cd ../../../..
78-
mv pan-os-ansible the_repo
79-
mv the_repo/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }} pan-os-ansible
80-
mkdir -p pan-os-ansible/ansible_collections/${{ env.NAMESPACE }}/${{ env.COLLECTION_NAME }}
81-
8254
- name: Deploy to GitHub Pages
8355
uses: JamesIves/github-pages-deploy-action@a1ea191d508feb8485aceba848389d49f80ca2dc # v4.4.3
8456
with:

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ docs/_diagrams
9292

9393
tests/output/
9494

95-
docs/html/
95+
# docs/html/ # this is pushed to gh-pages branch - do not push on other branches
9696
docs/source/_build/
9797
docs/source/modules/
9898

Makefile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,20 @@
77
collection := $(notdir $(realpath $(CURDIR) ))
88
namespace := $(notdir $(realpath $(CURDIR)/.. ))
99
toplevel := $(notdir $(realpath $(CURDIR)/../..))
10-
1110
err_msg := Place collection at <WHATEVER>/ansible_collections/paloaltonetworks/panos
12-
ifneq (panos,$(collection))
13-
$(error $(err_msg))
14-
else ifneq (paloaltonetworks,$(namespace))
15-
$(error $(err_msg))
16-
else ifneq (ansible_collections,$(toplevel))
17-
$(error $(err_msg))
11+
12+
# List of targets that require path check
13+
PATH_CHECK_TARGETS := old-sanity new-sanity
14+
15+
# Check if current target requires path check
16+
ifneq ($(filter $(MAKECMDGOALS),$(PATH_CHECK_TARGETS)),)
17+
ifneq (panos,$(collection))
18+
$(error $(err_msg))
19+
else ifneq (paloaltonetworks,$(namespace))
20+
$(error $(err_msg))
21+
else ifneq (ansible_collections,$(toplevel))
22+
$(error $(err_msg))
23+
endif
1824
endif
1925

2026
python_version := $(shell \
@@ -32,7 +38,7 @@ docs: ## Build collection documentation
3238
rm -rf docs/html
3339
rm -rf docs/source/modules
3440
mkdir antsibull
35-
poetry run antsibull-docs collection --use-current --dest-dir antsibull --no-indexes paloaltonetworks.panos
41+
antsibull-docs collection --use-current --dest-dir antsibull --no-indexes paloaltonetworks.panos
3642
mkdir -p docs/source/modules
3743
mv antsibull/collections/paloaltonetworks/panos/* docs/source/modules
3844
rm -rf antsibull

plugins/modules/panos_security_rule.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
- Robert Hagen (@stealthllama)
4141
- Michael Richardson (@mrichardson03)
4242
- Garfield Lee Freeman (@shinmog)
43+
- Alp Eren Kose (@alperenkose)
4344
version_added: '1.0.0'
4445
requirements:
4546
- pandevice can be obtained from PyPI U(https://pypi.python.org/pypi/pandevice)

0 commit comments

Comments
 (0)