-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
158 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
templates/github/.github/workflows/scripts/build_python_client.sh.j2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
#!/bin/bash | ||
|
||
# This script expects all <app_label>-api.json files to exist in the plugins root directory. | ||
# It produces a <app_label>-python-client.tar and <app_label>-python-client-docs.tar file in the plugins root directory. | ||
|
||
{% include 'header.j2' %} | ||
|
||
set -mveuo pipefail | ||
|
||
# make sure this script runs at the repo root | ||
cd "$(dirname "$(realpath -e "$0")")"/../../.. | ||
|
||
pushd ../pulp-openapi-generator | ||
{%- for plugin in plugins %} | ||
rm -rf "{{ plugin.name | snake }}-client" | ||
|
||
cp "../{{ plugin_name }}/{{ plugin.app_label }}-api.json" . | ||
./gen-client.sh "{{ plugin.app_label }}-api.json" "{{ plugin.app_label }}" python "{{ plugin.name_snake }}" | ||
|
||
pushd {{ plugin.name | snake }}-client | ||
python setup.py sdist bdist_wheel --python-tag py3 | ||
|
||
twine check "dist/{{ plugin.name | snake }}_client-"*"-py3-none-any.whl" | ||
twine check "dist/{{ plugin.name | snake }}-client-"*".tar.gz" | ||
|
||
tar cvf ../../{{ plugin_name }}/{{ plugin.app_label }}-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: {{ 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 }} | ||
theme: readthedocs | ||
DOCSYAML | ||
|
||
# Building the bindings docs | ||
mkdocs build | ||
|
||
# Pack the built site. | ||
tar cvf ../../{{ plugin_name }}/{{ plugin.app_label }}-python-client-docs.tar ./site | ||
popd | ||
{%- endfor %} | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters