Skip to content

Commit

Permalink
Merge branch 'develop' into CTOR-306-community-pr-allow-to-filter-act…
Browse files Browse the repository at this point in the history
…ive-mq-brokers-by-mbean-and-attributes
  • Loading branch information
lucie-dubrunfaut committed Mar 4, 2024
2 parents c158394 + 6393960 commit 571f2aa
Show file tree
Hide file tree
Showing 75 changed files with 4,449 additions and 439 deletions.
2 changes: 1 addition & 1 deletion .github/actions/deb-delivery-legacy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
key: ${{ inputs.cache_key }}
fail-on-cache-miss: true

- uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1
- uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/deb-delivery/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ runs:
fail-on-cache-miss: true

- if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }}
uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1
uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
Expand Down
65 changes: 65 additions & 0 deletions .github/actions/merge-artifacts/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: 'Merge Artifacts'
description: 'Merge Artifacts'
inputs:
target_name:
description: 'The name of the result artifact'
required: true
source_paths:
description: 'The path to the files that will be uplaoded'
required: true
source_name_pattern:
description: "Artifact's pattern to be merged"
required: true
github_token:
description: 'The Github Token to use'
required: true

runs:
using: 'composite'
steps:
- name: Download Artifacts
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
with:
pattern: ${{ inputs.source_name_pattern }}*
path: ${{ inputs.target_name }}
merge-multiple: true

- name: Upload the Regrouped Artifact
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
with:
name: ${{ inputs.target_name }}
path: |
${{ inputs.source_paths }}
retention-days: 1

- name: Delete Artifacts
run: |
artifact_pattern="${{ inputs.source_name_pattern }}"
TOKEN="${{ inputs.github_token }}"
artifact_exists=true
while [ "$artifact_exists" = true ]; do
artifact_exists=false
artifacts_response=$(curl -L \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://github.com/gitapi/repos/${{ github.repository }}/actions/artifacts?per_page=100")
artifacts=$(echo $artifacts_response | jq -c '.artifacts[]')
echo "Those are the artifacts : $artifacts"
while read row; do
artifact_name=$(echo "$row" | jq -r '.name')
if [[ "$artifact_name" =~ ^.*"$artifact_pattern".* ]]; then
artifact_exists=true
echo "Deleting : $artifact_name"
artifact_id=$(echo "$row" | jq -r '.id')
curl -L \
-X DELETE \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $TOKEN" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://github.com/gitapi/repos/${{ github.repository }}/actions/artifacts/${artifact_id}"
fi
done <<< "$artifacts"
done
echo "End of Deleting"
shell: bash
4 changes: 2 additions & 2 deletions .github/actions/package-nfpm/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ runs:
export DIST=""
if [ "${{ inputs.stability }}" == "unstable" ] || [ "${{ inputs.stability }}" == "canary" ]; then
export RELEASE="$RELEASE~${{ inputs.distrib }}"
elif [ "${{ inputs.stability }}" == "testing" ]; then
else
export RELEASE="1~${{ inputs.distrib }}"
fi
export APACHE_USER="www-data"
Expand Down Expand Up @@ -137,7 +137,7 @@ runs:
# Update if condition to true to get packages as artifacts
- if: ${{ false }}
name: Upload package artifacts
uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
with:
name: packages-${{ inputs.distrib }}
path: ./*.${{ inputs.package_extension}}
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/promote-to-stable/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ inputs:
runs:
using: "composite"
steps:
- uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1
- uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
Expand Down Expand Up @@ -60,7 +60,7 @@ runs:
shell: bash

- name: Promote DEB package to stable
if: ${{ startsWith(inputs.distrib, 'bullseye') || startsWith(inputs.distrib, 'bookworm' }}
if: ${{ contains(fromJSON('["bullseye", "bookworm"]'), inputs.distrib) }}
run: |
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/rpm-delivery-legacy/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ runs:
key: ${{ inputs.cache_key }}
fail-on-cache-miss: true

- uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1
- uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/rpm-delivery/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ runs:
key: ${{ inputs.cache_key }}
fail-on-cache-miss: true

- uses: jfrog/setup-jfrog-cli@901bb9632db90821c2d3f076012bdeaf66598555 # v3.4.1
- uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
env:
JF_URL: https://centreon.jfrog.io
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
Expand Down
39 changes: 0 additions & 39 deletions .github/actions/runner-docker/action.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ updates:
- package-ecosystem: github-actions
directory: '/'
schedule:
interval: weekly
interval: monthly
open-pull-requests-limit: 10
labels:
- 'dependencies'
Expand Down
9 changes: 9 additions & 0 deletions .github/scripts/stopwords.t
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
--filter-vdom
--force-counters32
Centreon
Fortinet
Fortigate
license-instances-usage-prct
MBean
OID
oneaccess-sys-mib
perfdata
powershell
queue-messages-inflighted
SNMP
space-usage-prct
SSH
SureBackup
topic-messages-inflighted
Veeam
38 changes: 27 additions & 11 deletions .github/workflows/connector-vmware.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ jobs:
version_file: connectors/vmware/src/centreon/script/centreon_vmware.pm

package:
needs:
- get-environment
needs: [get-environment]
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
runs-on: ubuntu-22.04
strategy:
matrix:
Expand Down Expand Up @@ -66,7 +66,7 @@ jobs:
distrib: ${{ matrix.distrib }}
package_extension: ${{ matrix.package_extension }}
version: ${{ needs.get-environment.outputs.version }}
release: ${{ needs.get-environment.outputs.release }}
release: 1
commit_hash: ${{ github.sha }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
Expand All @@ -75,10 +75,8 @@ jobs:
stability: ${{ needs.get-environment.outputs.stability }}

deliver-rpm:
needs:
- get-environment
- package
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]

strategy:
Expand All @@ -99,10 +97,8 @@ jobs:
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}

deliver-deb:
needs:
- get-environment
- package
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
needs: [get-environment, package]
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]

strategy:
Expand All @@ -121,3 +117,23 @@ jobs:
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}

promote:
needs: [get-environment]
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [el8, el9, bullseye, bookworm]

steps:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Promote ${{ matrix.distrib }} to stable
uses: ./.github/actions/promote-to-stable
with:
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
module: connector-vmware
distrib: ${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
Loading

0 comments on commit 571f2aa

Please sign in to comment.