Skip to content
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
168 changes: 168 additions & 0 deletions .github/actions/package-delivery-pulp/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,168 @@
name: "package-delivery"
description: "Deliver rpm and deb packages to pulp"
inputs:
module_name:
description: "The package module name"
required: true
distrib:
description: "The distribution used for packaging"
required: true
version:
description: "Centreon packaged major version (not used by the plugins repository family)"
required: false
default: ""
cache_key:
description: "The cached package key"
required: true
stability:
description: "The package stability (stable, testing, unstable)"
required: true
release_type:
description: "Type of release (hotfix, release)"
required: false
default: ""
is_cloud:
description: "Release context (cloud or not cloud)"
required: true
delivery_type:
description: "Delivery to feature or standard repository"
required: false
default: "standard"
repository_name:
description: "Target repository family: standard, standard-internal, business, business-internal or plugins"
required: false
default: "standard"
verify:
description: "Verify the delivered packages afterwards (presence, metadata resolution, fetchability)"
required: false
default: "true"
pulp_url:
description: "The pulp server api url"
required: true
pulp_content_url:
description: "The pulp server content url"
required: true
audience:
description: "OIDC audience, must match the pulp server GITHUB_OIDC.audience"
required: true

runs:
using: "composite"
steps:
- name: Validate inputs
shell: bash
env:
STABILITY: ${{ inputs.stability }}
DELIVERY_TYPE: ${{ inputs.delivery_type }}
run: |
set -euo pipefail

if [[ "$DELIVERY_TYPE" != "feature" && "$STABILITY" != "testing" && "$STABILITY" != "unstable" ]]; then
echo "::error::stability must be one of: testing, unstable (got '$STABILITY')"
exit 1
fi

- name: Compute pulp repository properties
id: pulp-properties
uses: ./.github/actions/pulp-repository-properties
with:
module_name: ${{ inputs.module_name }}
distrib: ${{ inputs.distrib }}
version: ${{ inputs.version }}
stability: ${{ inputs.stability }}
release_type: ${{ inputs.release_type }}
is_cloud: ${{ inputs.is_cloud }}
delivery_type: ${{ inputs.delivery_type }}
repository_name: ${{ inputs.repository_name }}

- name: Restore packages from cache
if: steps.pulp-properties.outputs.skip_delivery == 'false'
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ./*.${{ steps.pulp-properties.outputs.package_extension }}
key: ${{ inputs.cache_key }}
fail-on-cache-miss: true

- name: Setup pulp-cli
if: steps.pulp-properties.outputs.skip_delivery == 'false'
uses: ./.github/actions/setup-pulp-cli
with:
pulp_url: ${{ inputs.pulp_url }}
audience: ${{ inputs.audience }}
domain: ${{ steps.pulp-properties.outputs.domain }}

- name: Deliver RPM packages
id: deliver-rpm
if: steps.pulp-properties.outputs.package_extension == 'rpm' && steps.pulp-properties.outputs.skip_delivery == 'false'
shell: bash
env:
MODULE_NAME: ${{ inputs.module_name }}
DISTRIB: ${{ inputs.distrib }}
STABILITY: ${{ inputs.stability }}
REPOSITORY_PREFIX: ${{ steps.pulp-properties.outputs.repository_prefix }}
STABLE_REPOSITORY_PREFIX: ${{ steps.pulp-properties.outputs.stable_repository_prefix }}
BASE_PATH_PREFIX: ${{ steps.pulp-properties.outputs.base_path_prefix }}
LEGACY_BASE_PATH_PREFIX: ${{ steps.pulp-properties.outputs.legacy_base_path_prefix }}
PULP_URL: ${{ inputs.pulp_url }}
PULP_DOMAIN: ${{ steps.pulp-properties.outputs.domain }}
PULP_STABLE_DOMAIN: ${{ steps.pulp-properties.outputs.stable_domain }}
PULP_TOKEN: ${{ env.PULP_TOKEN }}
PULP_CONTENT_URL: ${{ inputs.pulp_content_url }}
run: ${{ github.action_path }}/deliver-rpm.sh

- name: Deliver DEB packages
id: deliver-deb
if: steps.pulp-properties.outputs.package_extension == 'deb' && steps.pulp-properties.outputs.skip_delivery == 'false'
shell: bash
env:
MODULE_NAME: ${{ inputs.module_name }}
DISTRIB: ${{ inputs.distrib }}
STABILITY: ${{ inputs.stability }}
REPOSITORY_NAME: ${{ steps.pulp-properties.outputs.repository_name }}
BASE_PATH: ${{ steps.pulp-properties.outputs.base_path }}
LEGACY_BASE_PATH: ${{ steps.pulp-properties.outputs.legacy_base_path }}
LEGACY_STABLE_BASE_PATH: ${{ steps.pulp-properties.outputs.legacy_stable_base_path }}
SUITE: ${{ steps.pulp-properties.outputs.suite }}
STABLE_SUITE: ${{ steps.pulp-properties.outputs.stable_suite }}
STABLE_BASE_PATH: ${{ steps.pulp-properties.outputs.stable_base_path }}
POOL_PATH: ${{ steps.pulp-properties.outputs.pool_path }}
PULP_URL: ${{ inputs.pulp_url }}
PULP_DOMAIN: ${{ steps.pulp-properties.outputs.domain }}
PULP_STABLE_DOMAIN: ${{ steps.pulp-properties.outputs.stable_domain }}
PULP_TOKEN: ${{ env.PULP_TOKEN }}
PULP_CONTENT_URL: ${{ inputs.pulp_content_url }}
run: ${{ github.action_path }}/deliver-deb.sh

- name: Verify RPM delivery
if: inputs.verify == 'true' && steps.pulp-properties.outputs.package_extension == 'rpm' && steps.pulp-properties.outputs.skip_delivery == 'false'
shell: bash
env:
MANIFEST: ${{ steps.deliver-rpm.outputs.manifest }}
CHECK_MODE: delivery
MODULE_NAME: ${{ inputs.module_name }}
DISTRIB: ${{ inputs.distrib }}
STABILITY: ${{ inputs.stability }}
PULP_URL: ${{ inputs.pulp_url }}
PULP_DOMAIN: ${{ steps.pulp-properties.outputs.domain }}
PULP_TOKEN: ${{ env.PULP_TOKEN }}
PULP_CONTENT_URL: ${{ inputs.pulp_content_url }}
run: |
${{ github.action_path }}/../../scripts/pulp/check-rpm.sh ||
echo "::warning::Pulp delivery verification failed for ${MODULE_NAME} on ${DISTRIB} (non-blocking during the Artifactory-to-Pulp migration, see the run summary table)"

- name: Verify DEB delivery
if: inputs.verify == 'true' && steps.pulp-properties.outputs.package_extension == 'deb' && steps.pulp-properties.outputs.skip_delivery == 'false'
shell: bash
env:
MANIFEST: ${{ steps.deliver-deb.outputs.manifest }}
CHECK_MODE: delivery
MODULE_NAME: ${{ inputs.module_name }}
DISTRIB: ${{ inputs.distrib }}
STABILITY: ${{ inputs.stability }}
PULP_URL: ${{ inputs.pulp_url }}
PULP_DOMAIN: ${{ steps.pulp-properties.outputs.domain }}
PULP_TOKEN: ${{ env.PULP_TOKEN }}
PULP_CONTENT_URL: ${{ inputs.pulp_content_url }}
run: |
${{ github.action_path }}/../../scripts/pulp/check-deb.sh ||
echo "::warning::Pulp delivery verification failed for ${MODULE_NAME} on ${DISTRIB} (non-blocking during the Artifactory-to-Pulp migration, see the run summary table)"
Loading
Loading