forked from pulp/pulp_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpublish_docs.sh
More file actions
executable file
·63 lines (48 loc) · 1.97 KB
/
Copy pathpublish_docs.sh
File metadata and controls
executable file
·63 lines (48 loc) · 1.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_python' to update this file.
#
# For more info visit https://github.com/pulp/plugin_template
set -euv
# make sure this script runs at the repo root
cd "$(dirname "$(realpath -e "$0")")"/../../..
mkdir ~/.ssh
touch ~/.ssh/pulp-infra
chmod 600 ~/.ssh/pulp-infra
echo "$PULP_DOCS_KEY" > ~/.ssh/pulp-infra
echo "docs.pulpproject.org,8.43.85.236 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBGXG+8vjSQvnAkq33i0XWgpSrbco3rRqNZr0SfVeiqFI7RN/VznwXMioDDhc+hQtgVhd6TYBOrV07IMcKj+FAzg=" >> /home/runner/.ssh/known_hosts
chmod 644 /home/runner/.ssh/known_hosts
pip3 install packaging
export PYTHONUNBUFFERED=1
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
ssh-add ~/.ssh/pulp-infra
python3 .github/workflows/scripts/docs-publisher.py --build-type $1 --branch $2
if [[ "$GITHUB_WORKFLOW" == "Python 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
cat >> mkdocs.yml << DOCSYAML
---
site_name: PulpPython Client
site_description: Python bindings
site_author: Pulp Team
site_url: https://docs.pulpproject.org/pulp_python_client/
repo_name: pulp/pulp_python
repo_url: https://github.com/pulp/pulp_python
theme: readthedocs
DOCSYAML
# Building the bindings docs
mkdocs build
# publish to docs.pulpproject.org/pulp_python_client
rsync -avzh site/ doc_builder_pulp_python@docs.pulpproject.org:/var/www/docs.pulpproject.org/pulp_python_client/
# publish to docs.pulpproject.org/pulp_python_client/en/{release}
rsync -avzh site/ doc_builder_pulp_python@docs.pulpproject.org:/var/www/docs.pulpproject.org/pulp_python_client/en/"$2"