Skip to content

Commit

Permalink
Update CI files
Browse files Browse the repository at this point in the history
[noissue]
  • Loading branch information
mdellweg committed Mar 8, 2024
1 parent ae72047 commit 018e17e
Show file tree
Hide file tree
Showing 18 changed files with 25 additions and 162 deletions.
9 changes: 9 additions & 0 deletions .ci/ansible/start_container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@
command: "docker logs pulp"
failed_when: true

- name: "Check version of component being tested"
assert:
that:
- (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] | canonical_semver == (component_version | canonical_semver)
fail_msg: |
Component {{ item.app_label }} was expected to be installed in version {{ component_version }}.
Instead it is reported as version {{ (result.json.versions | items2dict(key_name="component", value_name="version"))[item.app_label] }}.
loop: "{{ 'plugins' | ansible.builtin.extract(lookup('ansible.builtin.file', '../../template_config.yml') | from_yaml) }}"

- name: "Set pulp password in .netrc"
copy:
dest: "~/.netrc"
Expand Down
2 changes: 1 addition & 1 deletion .github/template_gitref
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2021.08.26-316-g69ef1f6
2021.08.26-319-ga283c28
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/create-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
find CHANGES -type f -regex ".*\.\(bugfix\|doc\|feature\|misc\|deprecation\|removal\)" -exec git rm {} +
- name: Checkout plugin template
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: pulp/plugin_template
path: plugin_template
Expand All @@ -85,7 +85,7 @@ jobs:
git add -A
- name: Make a PR with version bump and without CHANGES/*
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
path: pulp-certguard
token: ${{ secrets.RELEASE_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/kanban.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ jobs:
linked-issues: ${{ steps.linked-issues.outputs.issues }}
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Get Linked Issues Action
uses: kin/[email protected]
id: linked-issues
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: python .ci/scripts/collect_changes.py

- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.RELEASE_TOKEN }}
title: "Update Changelog"
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,6 @@ jobs:
run: |
.github/workflows/scripts/install_ruby_client.sh
shell: "bash"
- name: "Upload python client packages"
uses: "actions/upload-artifact@v3"
with:
name: "python-client.tar"
path: "pulp-certguard/certguard-python-client.tar"
if-no-files-found: "error"

- name: "Upload python client docs"
uses: "actions/upload-artifact@v3"
with:
name: "python-client-docs.tar"
path: "pulp-certguard/certguard-python-client-docs.tar"
if-no-files-found: "error"
- name: "Upload ruby client packages"
uses: "actions/upload-artifact@v3"
with:
name: "ruby-client.tar"
path: "pulp-certguard/certguard-ruby-client.tar"
if-no-files-found: "error"
- name: Build docs
run: |
export DJANGO_SETTINGS_MODULE=pulpcore.app.settings
Expand Down Expand Up @@ -191,7 +172,6 @@ jobs:

- name: "Untar python client packages"
run: |
tar -xvf certguard-python-client.tar
- uses: "actions/setup-python@v4"
with:
Expand Down Expand Up @@ -234,7 +214,6 @@ jobs:

- name: "Untar Ruby client packages"
run: |
tar -xvf certguard-ruby-client.tar
- uses: ruby/setup-ruby@v1
with:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ set -euv
source .github/workflows/scripts/utils.sh

PLUGIN_VERSION="$(sed -n -e 's/^\s*current_version\s*=\s*//p' .bumpversion.cfg | python -c 'from packaging.version import Version; print(Version(input()))')"
PLUGIN_NAME="./pulp-certguard/dist/pulp_certguard-${PLUGIN_VERSION}-py3-none-any.whl"
PLUGIN_SOURCE="./pulp-certguard/dist/pulp_certguard-${PLUGIN_VERSION}-py3-none-any.whl"

export PULP_API_ROOT="/pulp/"

Expand All @@ -31,7 +31,6 @@ pip install ${PIP_REQUIREMENTS[*]}


cd .ci/ansible/
PLUGIN_SOURCE="${PLUGIN_NAME}"

cat >> vars/main.yaml << VARSYAML
image:
Expand Down
42 changes: 0 additions & 42 deletions .github/workflows/scripts/install_python_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,46 +24,4 @@ REPORTED_VERSION="$(echo "$REPORTED_STATUS" | jq --arg plugin "certguard" -r '.v
VERSION="$(echo "$REPORTED_VERSION" | python -c 'from packaging.version import Version; print(Version(input()))')"

pushd ../pulp-openapi-generator
rm -rf pulp_certguard-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=certguard"
USE_LOCAL_API_JSON=1 ./generate.sh pulp_certguard python "$VERSION"
else
./generate.sh pulp_certguard python "$VERSION"
fi

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

twine check "dist/pulp_certguard_client-$VERSION-py3-none-any.whl"
twine check "dist/pulp_certguard-client-$VERSION.tar.gz"

cmd_prefix pip3 install "/root/pulp-openapi-generator/pulp_certguard-client/dist/pulp_certguard_client-${VERSION}-py3-none-any.whl"
tar cvf ../../pulp-certguard/certguard-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: Pulp-Certguard Client
site_description: Certguard bindings
site_author: Pulp Team
site_url: https://docs.pulpproject.org/pulp_certguard_client/
repo_name: pulp/pulp_certguard
repo_url: https://github.com/pulp/pulp_certguard
theme: readthedocs
DOCSYAML

# Building the bindings docs
mkdocs build

# Pack the built site.
tar cvf ../../pulp-certguard/certguard-python-client-docs.tar ./site
popd
popd
15 changes: 0 additions & 15 deletions .github/workflows/scripts/install_ruby_client.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,4 @@ REPORTED_VERSION="$(echo "$REPORTED_STATUS" | jq --arg plugin "certguard" -r '.v
VERSION="$(echo "$REPORTED_VERSION" | python -c 'from packaging.version import Version; print(Version(input()))')"

pushd ../pulp-openapi-generator
rm -rf pulp_certguard-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=certguard"
USE_LOCAL_API_JSON=1 ./generate.sh pulp_certguard ruby "$VERSION"
else
./generate.sh pulp_certguard ruby "$VERSION"
fi

pushd pulp_certguard-client
gem build pulp_certguard_client
gem install --both "./pulp_certguard_client-$VERSION.gem"
tar cvf ../../pulp-certguard/certguard-ruby-client.tar "./pulp_certguard_client-$VERSION.gem"
popd
popd
1 change: 0 additions & 1 deletion .github/workflows/scripts/publish_client_gem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,3 @@ touch ~/.gem/credentials
echo "---
:rubygems_api_key: $RUBYGEMS_API_KEY" > ~/.gem/credentials
sudo chmod 600 ~/.gem/credentials
gem push "pulp_certguard_client-${VERSION}.gem"
2 changes: 0 additions & 2 deletions .github/workflows/scripts/publish_client_pypi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,4 @@ then
fi

twine upload -u __token__ -p "$PYPI_API_TOKEN" \
"dist/pulp_certguard_client-$VERSION-py3-none-any.whl" \
"dist/pulp_certguard-client-$VERSION.tar.gz" \
;
11 changes: 0 additions & 11 deletions .github/workflows/scripts/publish_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,3 @@ if [[ "$GITHUB_WORKFLOW" == "Certguard changelog update" ]]; then
# Do not build bindings docs on changelog update
exit
fi

mkdir -p ../certguard-bindings
tar -xvf certguard-python-client-docs.tar --directory ../certguard-bindings
pushd ../certguard-bindings

# publish to docs.pulpproject.org/pulp_certguard_client
rsync -avzh site/ [email protected]:/var/www/docs.pulpproject.org/pulp_certguard_client/

# publish to docs.pulpproject.org/pulp_certguard_client/en/{release}
rsync -avzh site/ [email protected]:/var/www/docs.pulpproject.org/pulp_certguard_client/en/"$2"
popd
29 changes: 2 additions & 27 deletions .github/workflows/scripts/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ then
done
else
# Sadly: Different pulpcore-versions aren't either...
for item in $(jq -r '.versions[]| select(.component!="certguard")| tojson' <<<"$REPORTED_STATUS")
for item in $(jq -r '.versions[]| tojson' <<<"$REPORTED_STATUS")
do
echo $item
COMPONENT="$(jq -r '.component' <<<"$item")"
Expand Down Expand Up @@ -104,7 +104,7 @@ else
done
else
# Sadly: Different pulpcore-versions aren't either...
for item in $(echo "$REPORTED_STATUS" | jq -r '.versions[]|select(.component!="certguard")|(.package // ("pulp_" + .component)|sub("pulp_core"; "pulpcore"))|sub("-"; "_")')
for item in $(echo "$REPORTED_STATUS" | jq -r '.versions[]|(.package // ("pulp_" + .component)|sub("pulp_core"; "pulpcore"))|sub("-"; "_")')
do
./generate.sh "${item}" python
cmd_prefix pip3 install "/root/pulp-openapi-generator/${item}-client"
Expand All @@ -126,33 +126,8 @@ cmd_prefix bash -c "cat /etc/pulp/certs/pulp_webserver.crt >> '$CERTIFI'"

# check for any uncommitted migrations
echo "Checking for uncommitted migrations..."
cmd_user_prefix bash -c "django-admin makemigrations certguard --check --dry-run"

# Run unit tests.
cmd_user_prefix bash -c "PULP_DATABASES__default__USER=postgres pytest -v -r sx --color=yes --suppress-no-test-exit-code -p no:pulpcore --pyargs pulp_certguard.tests.unit"

# Run functional tests
if [[ "$TEST" == "performance" ]]; then
if [[ -z ${PERFORMANCE_TEST+x} ]]; then
cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --suppress-no-test-exit-code --capture=no --durations=0 --pyargs pulp_certguard.tests.performance"
else
cmd_user_prefix bash -c "pytest -vv -r sx --color=yes --suppress-no-test-exit-code --capture=no --durations=0 --pyargs pulp_certguard.tests.performance.test_${PERFORMANCE_TEST}"
fi
exit
fi

if [ -f "$FUNC_TEST_SCRIPT" ]; then
source "$FUNC_TEST_SCRIPT"
else
if [[ "$GITHUB_WORKFLOW" =~ "Nightly" ]]
then
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_certguard.tests.functional -m parallel -n 8 --nightly"
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_certguard.tests.functional -m 'not parallel' --nightly"
else
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_certguard.tests.functional -m parallel -n 8"
cmd_user_prefix bash -c "pytest -v -r sx --color=yes --suppress-no-test-exit-code --pyargs pulp_certguard.tests.functional -m 'not parallel'"
fi
fi

if [ -f "$POST_SCRIPT" ]; then
source "$POST_SCRIPT"
Expand Down
25 changes: 0 additions & 25 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,31 +110,6 @@ jobs:
ANSIBLE_FORCE_COLOR: "1"
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
GITHUB_CONTEXT: "${{ github.event.pull_request.commits_url }}"
- name: Upload python client packages
if: ${{ env.TEST == 'pulp' }}
uses: actions/upload-artifact@v3
with:
name: "python-client.tar"
path: "pulp-certguard/certguard-python-client.tar"
if-no-files-found: "error"
retention-days: 5

- name: Upload python client docs
if: ${{ env.TEST == 'pulp' }}
uses: actions/upload-artifact@v3
with:
name: "python-client-docs.tar"
path: "pulp-certguard/certguard-python-client-docs.tar"
if-no-files-found: "error"
retention-days: 5
- name: Upload Ruby client
if: ${{ env.TEST == 'pulp' }}
uses: actions/upload-artifact@v3
with:
name: "ruby-client.tar"
path: "pulp-certguard/certguard-ruby-client.tar"
if-no-files-found: "error"
retention-days: 5
- name: Upload built docs
if: ${{ env.TEST == 'docs' }}
uses: actions/upload-artifact@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
echo ::group::PYDEPS
pip install requests pyyaml
echo ::endgroup::
- uses: "actions/checkout@v3"
- uses: "actions/checkout@v4"
- name: "Update labels"
run: |
python3 .github/workflows/scripts/update_backport_labels.py
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/update_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
../plugin_template/scripts/update_ci.sh
- name: "Create Pull Request for CI files"
uses: "peter-evans/create-pull-request@v4"
uses: "peter-evans/create-pull-request@v6"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulp-certguard"
Expand All @@ -82,7 +82,7 @@ jobs:
../plugin_template/scripts/update_ci.sh
- name: "Create Pull Request for CI files"
uses: "peter-evans/create-pull-request@v4"
uses: "peter-evans/create-pull-request@v6"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulp-certguard"
Expand All @@ -109,7 +109,7 @@ jobs:
../plugin_template/scripts/update_ci.sh
- name: "Create Pull Request for CI files"
uses: "peter-evans/create-pull-request@v4"
uses: "peter-evans/create-pull-request@v6"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulp-certguard"
Expand All @@ -136,7 +136,7 @@ jobs:
../plugin_template/scripts/update_ci.sh
- name: "Create Pull Request for CI files"
uses: "peter-evans/create-pull-request@v4"
uses: "peter-evans/create-pull-request@v6"
with:
token: "${{ secrets.RELEASE_TOKEN }}"
path: "pulp-certguard"
Expand Down
7 changes: 2 additions & 5 deletions template_config.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This config represents the latest values used when running the plugin-template. Any settings that
# were not present before running plugin-template have been added with their default values.

# generated with [email protected]316-g69ef1f6
# generated with [email protected]319-ga283c28

api_root: /pulp/
black: true
Expand Down Expand Up @@ -37,9 +37,7 @@ parallel_test_workers: 8
plugin_app_label: certguard
plugin_default_branch: main
plugin_name: pulp-certguard
plugins:
- app_label: certguard
name: pulp-certguard
plugins: []
post_job_template: null
pre_job_template: null
publish_docs_to_pulpprojectdotorg: true
Expand All @@ -52,7 +50,6 @@ pulp_settings: null
pulp_settings_azure: null
pulp_settings_gcp: null
pulp_settings_s3: null
pulpprojectdotorg_key_id: null
pydocstyle: true
release_email: [email protected]
release_user: pulpbot
Expand Down

0 comments on commit 018e17e

Please sign in to comment.