Skip to content

Commit

Permalink
enh(promote): handle debian package promotion for multiple distributi…
Browse files Browse the repository at this point in the history
…ons (#1276)

* enh(promote): handle debian package promotion for multiple distributions

* Update .github/actions/promote-to-stable/action.yml

Co-authored-by: Kevin Duret <kduret@centreon.com>

---------

Co-authored-by: Kevin Duret <kduret@centreon.com>
  • Loading branch information
tuntoja and kduret authored Apr 22, 2024
1 parent 18e6b8e commit b3fa0e7
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/actions/promote-to-stable/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,14 @@ runs:
- name: Promote DEB packages to stable
if: ${{ contains(fromJSON('["bullseye", "bookworm"]'), inputs.distrib) }}
run: |
set -eux
echo "[DEBUG] - Major version: ${{ inputs.major_version }}"
echo "[DEBUG] - Minor version: ${{ inputs.minor_version }}"
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
echo "[DEBUG] - Get path of testing DEB packages to promote to stable."
SRC_PATHS=$(jf rt s --include-dirs apt-standard-${{ inputs.major_version }}-testing/pool/${{ inputs.module_name }}/*.deb | jq -r '.[].path')
SRC_PATHS=$(jf rt search --include-dirs apt-standard-${{ inputs.major_version }}-testing/pool/${{ inputs.module_name }}/*${{ inputs.major_version }}.${{ inputs.minor_version }}*${{ inputs.distrib }}*.deb | jq -r '.[].path')
if [[ ${SRC_PATHS[@]} ]]; then
for SRC_PATH in ${SRC_PATHS[@]}; do
Expand All @@ -141,6 +143,11 @@ runs:
for ARTIFACT_DL in $(dir|grep -E "*.deb"); do
ARCH=$(echo $ARTIFACT_DL | cut -d '_' -f3 | cut -d '.' -f1)
DISTRIB=$(echo $ARTIFACT_DL | cut -d '_' -f2 | cut -d '-' -f2)
if [[ "${{ inputs.distrib }}" != "$DISTRIB" ]]; then
echo "::error::Distrib [$DISTRIB] from package does not match distrib [${{ inputs.distrib }}] from input, abort promotion."
exit 1
fi
echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH."
jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH" --flat
done
Expand Down

4 comments on commit b3fa0e7

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
12 1 0 13 92.31 0s

Failed Tests

Name Message ⏱️ Duration Suite
not13 The first notification of U1 is not sent 0.000 s Notification

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
12 1 0 13 92.31 0s

Failed Tests

Name Message ⏱️ Duration Suite
not13 The first notification of U1 is not sent 0.000 s Notification

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
12 1 0 13 92.31 0s

Failed Tests

Name Message ⏱️ Duration Suite
not13 The first notification of U1 is not sent 0.000 s Notification

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Robot Results

✅ Passed ❌ Failed ⏭️ Skipped Total Pass % ⏱️ Duration
24 2 0 26 92.31 0s

Failed Tests

Name Message ⏱️ Duration Suite
not13 The first notification of U1 is not sent 0.000 s Notification
not13 The first notification of U1 is not sent 0.000 s Notification

Please sign in to comment.