Skip to content

Commit

Permalink
enh(ci): run promote job in dry-run mode on testing branches (#1691) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kduret authored Oct 1, 2024
1 parent dcd2e0c commit 5dd0e87
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 12 deletions.
18 changes: 14 additions & 4 deletions .github/actions/promote-to-stable/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ runs:
# Build target path based on ARCH
echo "[DEBUG] - Build $ARCH target path."
TARGET_PATH="$ROOT_REPO_PATH/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/"
TARGET_PATH="$ROOT_REPO_PATH/${{ inputs.major_version }}/${{ inputs.distrib }}/stable/$ARCH/RPMS/${{ inputs.module_name }}/"
echo "[DEBUG] - Target path: $TARGET_PATH"
# Download candidates for promote
Expand All @@ -97,10 +97,15 @@ runs:
jf rt download $ARTIFACT --flat
done
DRY_RUN_FLAG="--dry-run"
if [ "${{ inputs.stability }}" == "stable" ]; then
DRY_RUN_FLAG=""
fi
# Upload previously downloaded candidates to TARGET_PATH
for ARTIFACT_DL in $(dir|grep -E "*.rpm"); do
echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH."
jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --flat
jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --flat $DRY_RUN_FLAG
done
# Cleanup before next round of candidates
Expand Down Expand Up @@ -143,7 +148,7 @@ runs:
fi
echo "[DEBUG] - Build target path."
TARGET_PATH="$ROOT_REPO_PATH-${{ inputs.stability }}/pool/${{ inputs.module_name }}/"
TARGET_PATH="$ROOT_REPO_PATH-stable/pool/${{ inputs.module_name }}/"
echo "[DEBUG] - Target path: $TARGET_PATH"
echo "[DEBUG] - Promoting DEB testing artifacts to stable."
Expand All @@ -161,10 +166,15 @@ runs:
;;
esac
DRY_RUN_FLAG="--dry-run"
if [ "${{ inputs.stability }}" == "stable" ]; then
DRY_RUN_FLAG=""
fi
for ARTIFACT_DL in $(dir -1|grep -E $ARTIFACT_SEARCH_PATTERN); do
ARCH=$(echo $ARTIFACT_DL | cut -d '_' -f3 | cut -d '.' -f1)
echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH."
jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH" --flat
jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH" --flat $DRY_RUN_FLAG
done
rm -f *.deb
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/centreon-collect.yml
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,12 @@ jobs:
release_cloud: ${{ needs.get-version.outputs.release_cloud }}

promote:
needs: [get-version]
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
needs: [get-version, deliver-rpm, deliver-deb]
if: |
(contains(fromJson('["stable", "testing"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/gorgone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@ jobs:
release_cloud: ${{ needs.get-version.outputs.release_cloud }}

promote:
needs: [get-version]
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
needs: [get-version, deliver-rpm, deliver-deb]
if: |
(contains(fromJson('["stable", "testing"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/libzmq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,12 @@ jobs:
release_cloud: ${{ needs.get-version.outputs.release_cloud }}

promote:
needs: [get-version]
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
needs: [get-version, deliver-rpm, deliver-deb]
if: |
(contains(fromJson('["stable", "testing"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/lua-curl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,12 @@ jobs:
release_cloud: ${{ needs.get-version.outputs.release_cloud }}

promote:
needs: [get-version]
if: ${{ contains(fromJson('["stable"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch' }}
needs: [get-version, deliver-rpm, deliver-deb]
if: |
(contains(fromJson('["stable", "testing"]'), needs.get-version.outputs.stability) && github.event_name != 'workflow_dispatch') &&
! cancelled() &&
! contains(needs.*.result, 'failure') &&
! contains(needs.*.result, 'cancelled')
runs-on: [self-hosted, common]
strategy:
matrix:
Expand Down

2 comments on commit 5dd0e87

@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
14 1 0 15 93.33 0s

Failed Tests

Name Message ⏱️ Duration Suite
BENCH_10000STATUS AttributeError: 'NoneType' object has no attribute 'query_read_bytes' 0.000 s Bench

@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
19 1 0 20 95.00 0s

Failed Tests

Name Message ⏱️ Duration Suite
BDBU1 Central Broker not correctly stopped (coredump generated) 0.000 s Sql

Please sign in to comment.