Skip to content

Commit

Permalink
Fix docs publishing with the new plugins list
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Nov 22, 2023
1 parent b889ae0 commit 5a85a4c
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 35 deletions.
1 change: 1 addition & 0 deletions plugin-template
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ DEPRECATED_FILES = {
".ci/scripts/redmine.py",
".ci/scripts/release_requirements.txt",
".ci/scripts/release.py",
".ci/scripts/tweet.py",
".ci/scripts/update_ci_branches.py",
".ci/scripts/update_github.sh",
".ci/scripts/update_redmine.sh",
Expand Down
16 changes: 0 additions & 16 deletions templates/github/.ci/scripts/tweet.py.j2

This file was deleted.

4 changes: 2 additions & 2 deletions templates/github/.github/workflows/nightly.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ jobs:
uses: actions/download-artifact@v3
with:
name: "docs.tar"
path: "{{ plugin_name }}/docs.tar"
path: "{{ plugin_name }}"

- name: Download Python client docs
uses: actions/download-artifact@v3
with:
name: "python-client-docs.tar"
path: "{{ plugin_name }}/python-client-docs.tar"
path: "{{ plugin_name }}"

{{ set_secrets() | indent(6) }}

Expand Down
2 changes: 1 addition & 1 deletion templates/github/.github/workflows/release.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ jobs:

{{ set_secrets() | indent(6) }}

{{ install_python_deps("gitpython requests packaging~=21.3 tweepy") | indent(6) }}
{{ install_python_deps("gitpython requests packaging~=21.3") | indent(6) }}

- name: Push branch and tag to GitHub
run: bash .github/workflows/scripts/push_branch_and_tag_to_github.sh {{ "${{ github.event.inputs.release }}" }}
Expand Down
37 changes: 21 additions & 16 deletions templates/github/.github/workflows/scripts/publish_docs.sh.j2
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
set -euv

# make sure this script runs at the repo root
cd "$(dirname "$(realpath -e "$0")")"/../../..
cd "$(dirname "$(realpath -e "$0")")/../../.."

mkdir ~/.ssh
touch ~/.ssh/pulp-infra
Expand All @@ -22,37 +22,42 @@ export DJANGO_SETTINGS_MODULE=pulpcore.app.settings
export PULP_SETTINGS=$PWD/.ci/ansible/settings/settings.py
export WORKSPACE=$PWD

eval "$(ssh-agent -s)" #start the ssh agent
# start the ssh agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/pulp-infra

python3 .github/workflows/scripts/docs-publisher.py --build-type $1 --branch $2
python3 .github/workflows/scripts/docs-publisher.py --build-type "$1" --branch "$2"

if [[ "$GITHUB_WORKFLOW" == "{{ plugin_app_label | camel | default("Pulp") }} changelog update" ]]; then
if [[ "$GITHUB_WORKFLOW" == "{{ plugin_app_label | camel }} changelog update" ]]; then
# Do not build bindings docs on changelog update
exit
fi

pip install mkdocs pymdown-extensions "Jinja2<3.1"

mkdir -p ../bindings
tar -xvf python-client-docs.tar --directory ../bindings
cd ../bindings
{%- for plugin in plugins %}

mkdir -p ../{{ plugin.app_label }}-bindings
tar -xvf {{ plugin.app_label }}-python-client-docs.tar --directory ../{{ plugin.app_label }}-bindings
pushd ../{{ plugin.app_label }}-bindings
cat >> mkdocs.yml << DOCSYAML
---
site_name: {{ plugin_name | camel }} Client
site_description: {{ plugin_app_label | camel }} bindings
site_name: {{ plugin.name | camel }} Client
site_description: {{ plugin.app_label | camel }} bindings
site_author: Pulp Team
site_url: https://docs.pulpproject.org/{{ plugin_name | snake }}_client/
repo_name: pulp/{{ plugin_name | snake }}
repo_url: https://github.com/pulp/{{ plugin_name | snake }}
site_url: https://docs.pulpproject.org/{{ plugin.name | snake }}_client/
repo_name: pulp/{{ plugin.name | snake }}
repo_url: https://github.com/pulp/{{ plugin.name | snake }}
theme: readthedocs
DOCSYAML

# Building the bindings docs
mkdocs build

# publish to docs.pulpproject.org/{{ plugin_name | snake }}_client
rsync -avzh site/ doc_builder_{{ plugin_name | snake }}@docs.pulpproject.org:/var/www/docs.pulpproject.org/{{ plugin_name | snake }}_client/
# publish to docs.pulpproject.org/{{ plugin.name | snake }}_client
rsync -avzh site/ doc_builder_{{ plugin.name | snake }}@docs.pulpproject.org:/var/www/docs.pulpproject.org/{{ plugin.name | snake }}_client/

# publish to docs.pulpproject.org/{{ plugin_name | snake }}_client/en/{release}
rsync -avzh site/ doc_builder_{{ plugin_name | snake }}@docs.pulpproject.org:/var/www/docs.pulpproject.org/{{ plugin_name | snake }}_client/en/"$2"
# publish to docs.pulpproject.org/{{ plugin.name | snake }}_client/en/{release}
rsync -avzh site/ doc_builder_{{ plugin.name | snake }}@docs.pulpproject.org:/var/www/docs.pulpproject.org/{{ plugin.name | snake }}_client/en/"$2"
popd
{%- endfor %}

0 comments on commit 5a85a4c

Please sign in to comment.