Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI files for branch 3.18 #3666

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ci/ansible/Containerfile.j2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ RUN pip3 install
{{ " " }}-r ./{{ item.name }}/ci_requirements.txt
{%- endif -%}
{%- endfor %}
{{ " " }}-c ./{{ plugins[0].name }}/.ci/assets/ci_constraints.txt

{% if pulp_env is defined and pulp_env %}
{% for key, value in pulp_env.items() %}
Expand Down
Empty file removed .ci/assets/bindings/.gitkeep
Empty file.
7 changes: 7 additions & 0 deletions .ci/assets/ci_constraints.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Pulpcore versions without the openapi command do no longer work in the CI
pulpcore>=3.21.30,!=3.23.*,!=3.24.*,!=3.25.*,!=3.26.*,!=3.27.*,!=3.29.*,!=3.30.*,!=3.31.*,!=3.32.*,!=3.33.*,!=3.34.*,!=3.35.*,!=3.36.*,!=3.37.*,!=3.38.*,!=3.40.*,!=3.41.*,!=3.42.*,!=3.43.*,!=3.44.*,!=3.45.*,!=3.46.*,!=3.47.*,!=3.48.*,!=3.50.*,!=3.51.*,!=3.52.*,!=3.53.*,!=3.54.*



tablib!=3.6.0
# 3.6.0: This release introduced a regression removing the "html" optional dependency.
70 changes: 0 additions & 70 deletions .ci/scripts/changelog.py

This file was deleted.

69 changes: 0 additions & 69 deletions .ci/scripts/cherrypick.sh

This file was deleted.

16 changes: 0 additions & 16 deletions .ci/scripts/tweet.py

This file was deleted.

25 changes: 0 additions & 25 deletions .ci/scripts/update_ci_branches.py

This file was deleted.

24 changes: 0 additions & 24 deletions .ci/scripts/upper_bound.py

This file was deleted.

2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-342-g13e7dc5
2021.08.26-348-gb87ed3b
55 changes: 53 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,26 @@ jobs:
with:
fetch-depth: 1
path: "pulp_rpm"
- uses: "actions/checkout@v4"
with:
fetch-depth: 1
repository: "pulp/pulp-openapi-generator"
path: "pulp-openapi-generator"
- uses: "actions/setup-python@v5"
with:
python-version: "3.11"
- name: "Install python dependencies"
run: |
echo ::group::PYDEPS
pip install packaging twine wheel
pip install packaging twine wheel mkdocs jq
echo ::endgroup::
- name: "Build package"
run: |
python3 setup.py sdist bdist_wheel --python-tag py3
twine check dist/*
- name: "Install built packages"
run: |
pip install dist/pulp_rpm-*-py3-none-any.whl
pip install dist/pulp_rpm-*-py3-none-any.whl -c .ci/assets/ci_constraints.txt
- name: "Generate api specs"
run: |
pulpcore-manager openapi --file "api.json"
Expand All @@ -60,3 +65,49 @@ jobs:
if-no-files-found: "error"
retention-days: 5
overwrite: true
- name: "Build Python bindings packages"
run: |
.github/workflows/scripts/build_python_client.sh
shell: "bash"
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"
- name: "Upload python client packages"
uses: "actions/upload-artifact@v4"
with:
name: "python-client.tar"
path: |
pulp_rpm/rpm-python-client.tar
if-no-files-found: "error"
retention-days: 5
overwrite: true
- name: "Upload python client docs"
uses: "actions/upload-artifact@v4"
with:
name: "python-client-docs.tar"
path: |
pulp_rpm/rpm-python-client-docs.tar
if-no-files-found: "error"
retention-days: 5
overwrite: true
- name: "Build Ruby bindings packages"
run: |
.github/workflows/scripts/build_ruby_client.sh
shell: "bash"
env:
PY_COLORS: "1"
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"
- name: "Upload Ruby client"
uses: "actions/upload-artifact@v4"
with:
name: "ruby-client.tar"
path: |
pulp_rpm/rpm-ruby-client.tar
if-no-files-found: "error"
retention-days: 5
overwrite: true
...
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/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.

# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
Expand All @@ -12,36 +15,20 @@ 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 "rpm" -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_rpm-client
rm -rf "pulp_rpm-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=rpm"
USE_LOCAL_API_JSON=1 ./generate.sh pulp_rpm python "$VERSION"
else
./generate.sh pulp_rpm python "$VERSION"
fi
# We need to copy that over to be visible in the container.
cp "../pulp_rpm/rpm-api.json" .
./gen-client.sh "rpm-api.json" "rpm" python "pulp_rpm"

pushd pulp_rpm-client
python setup.py sdist bdist_wheel --python-tag py3

twine check "dist/pulp_rpm_client-$VERSION-py3-none-any.whl"
twine check "dist/pulp_rpm-client-$VERSION.tar.gz"
twine check "dist/pulp_rpm_client-"*"-py3-none-any.whl"
twine check "dist/pulp_rpm-client-"*".tar.gz"

cmd_prefix pip3 install "/root/pulp-openapi-generator/pulp_rpm-client/dist/pulp_rpm_client-${VERSION}-py3-none-any.whl"
tar cvf ../../pulp_rpm/rpm-python-client.tar ./dist
tar cvf "../../pulp_rpm/rpm-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' {} \;
Expand Down
35 changes: 35 additions & 0 deletions .github/workflows/scripts/build_ruby_client.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/bin/bash

# This script expects all <app_label>-api.json files to exist in the plugins root directory.
# It produces a <app_label>-ruby-client.tar file in the plugins root directory.

# WARNING: DO NOT EDIT!
#
# This file was generated by plugin_template, and is managed by it. Please use
# './plugin-template --github pulp_rpm' 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")")"/../../..

pushd ../pulp-openapi-generator
rm -rf "pulp_rpm-client"

# We need to copy that over to be visible in the container.
#cp "../pulp_rpm/rpm-api.json" .
#./gen-client.sh "rpm-api.json" "rpm" ruby "pulp_rpm"

# -------------
# The generator still needs to have it called api.json at this time...
cp "../pulp_rpm/api.json" .
./gen-client.sh "api.json" "rpm" ruby "pulp_rpm"
# -------------

pushd pulp_rpm-client
gem build pulp_rpm_client
tar cvf "../../pulp_rpm/rpm-ruby-client.tar" "./pulp_rpm_client-"*".gem"
popd
popd
Loading
Loading