forked from pulp/pulp_python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall_python_client.sh
More file actions
executable file
·69 lines (54 loc) · 2.14 KB
/
Copy pathinstall_python_client.sh
File metadata and controls
executable file
·69 lines (54 loc) · 2.14 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
64
65
66
67
68
69
#!/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 -mveuo pipefail
# make sure this script runs at the repo root
cd "$(dirname "$(realpath -e "$0")")"/../../..
source .github/workflows/scripts/utils.sh
PULP_URL="${PULP_URL:-https://pulp}"
export PULP_URL
PULP_API_ROOT="${PULP_API_ROOT:-/pulp/}"
export PULP_API_ROOT
REPORTED_STATUS="$(pulp status)"
REPORTED_VERSION="$(echo "$REPORTED_STATUS" | jq --arg plugin "python" -r '.versions[] | select(.component == $plugin) | .version')"
VERSION="$(echo "$REPORTED_VERSION" | python -c 'from packaging.version import Version; print(Version(input()))')"
pushd ../pulp-openapi-generator
rm -rf pulp_python-client
if pulp debug has-plugin --name "core" --specifier ">=3.44.0.dev"
then
curl --fail-with-body -k -o api.json "${PULP_URL}${PULP_API_ROOT}api/v3/docs/api.json?bindings&component=python"
USE_LOCAL_API_JSON=1 ./generate.sh pulp_python python "$VERSION"
else
./generate.sh pulp_python python "$VERSION"
fi
pushd pulp_python-client
python setup.py sdist bdist_wheel --python-tag py3
twine check "dist/pulp_python_client-$VERSION-py3-none-any.whl"
twine check "dist/pulp_python-client-$VERSION.tar.gz"
cmd_prefix pip3 install "/root/pulp-openapi-generator/pulp_python-client/dist/pulp_python_client-${VERSION}-py3-none-any.whl"
tar cvf ../../pulp_python/python-python-client.tar ./dist
find ./docs/* -exec sed -i 's/Back to README/Back to HOME/g' {} \;
find ./docs/* -exec sed -i 's/README//g' {} \;
cp README.md docs/index.md
sed -i 's/docs\///g' docs/index.md
find ./docs/* -exec sed -i 's/\.md//g' {} \;
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
# Pack the built site.
tar cvf ../../pulp_python/python-python-client-docs.tar ./site
popd
popd