Skip to content

Commit 21e597a

Browse files
authored
Merge pull request #6035 from centreon/release-20260300
Release 20260300
2 parents 1f128ba + 3260ceb commit 21e597a

197 files changed

Lines changed: 17796 additions & 1367 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.githooks/pre-commit.d/20_plugins.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ robotidy_path=$(type -p robocop) || robotidy_path=$(type -p robotidy) || fatal "
3838
robotidy_exe="${robotidy_path##*/}"
3939
info "Robot lint tool is $robotidy_exe"
4040
# Options depend on the use binary
41-
declare -A robotidy_opts=([robotidy]="-->-check --skip-keyword-call Examples:" [robocop]="check --ignore DOC02 --ignore LEN08 --ignore LEN04" )
41+
declare -A robotidy_opts=([robotidy]="-->-check --skip-keyword-call Examples:" [robocop]="check --ignore DOC02 --ignore LEN08 --ignore LEN04 --ignore DOC03 --ignore NAME07" )
4242
# Get list of committed files
4343
mapfile -t committed_files < <(git diff --cached --name-only --diff-filter=ACMR)
4444
info "Starting plugins pre-commit hooks for ${#committed_files[@]} files"

.github/actions/create-jira-ticket/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ inputs:
2222
runs:
2323
using: "composite"
2424
steps:
25-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
2626

2727
- uses: actions/setup-node@cdca7365b2dadb8aad0a33bc7601856ffabcc48e # v4.3.0
2828
with:
@@ -96,7 +96,7 @@ runs:
9696
} else if (["unit-tests", "fatpacker", "test-plugins"].includes(failed_job)) {
9797
ticket_squad_id = 10504
9898
ticket_board_id = 222
99-
squad_name = "COLLECT"
99+
squad_name = "CONNECTORS"
100100
project_name = "CTOR"
101101
} else {
102102
core.setFailed(`Not finding any squad association with job ${failed_job}.`);

.github/actions/merge-artifacts/action.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,32 +18,36 @@ runs:
1818
using: 'composite'
1919
steps:
2020
- name: Download Artifacts
21-
uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0
21+
uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
2222
with:
2323
pattern: ${{ inputs.source_name_pattern }}*
2424
path: ${{ inputs.target_name }}
2525
merge-multiple: true
2626

2727
- name: Upload the Regrouped Artifact
28-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
28+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
2929
with:
3030
name: ${{ inputs.target_name }}
3131
path: |
3232
${{ inputs.source_paths }}
3333
retention-days: 1
3434

3535
- name: Delete Artifacts
36+
env:
37+
SOURCE_NAME_PATTERN: ${{ inputs.source_name_pattern }}
38+
GITHUB_TOKEN: ${{ inputs.github_token }}
39+
GITHUB_REPOSITORY: ${{ github.repository }}
3640
run: |
37-
artifact_pattern="${{ inputs.source_name_pattern }}"
38-
TOKEN="${{ inputs.github_token }}"
41+
artifact_pattern="$SOURCE_NAME_PATTERN"
42+
TOKEN="$GITHUB_TOKEN"
3943
artifact_exists=true
4044
while [ "$artifact_exists" = true ]; do
4145
artifact_exists=false
4246
artifacts_response=$(curl -L \
4347
-H "Accept: application/vnd.github+json" \
4448
-H "Authorization: Bearer $TOKEN" \
4549
-H "X-GitHub-Api-Version: 2022-11-28" \
46-
"https://api.github.com/repos/${{ github.repository }}/actions/artifacts?per_page=100")
50+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/artifacts?per_page=100")
4751
artifacts=$(echo $artifacts_response | jq -c '.artifacts[]')
4852
echo "Those are the artifacts : $artifacts"
4953
while read row; do
@@ -57,7 +61,7 @@ runs:
5761
-H "Accept: application/vnd.github+json" \
5862
-H "Authorization: Bearer $TOKEN" \
5963
-H "X-GitHub-Api-Version: 2022-11-28" \
60-
"https://api.github.com/repos/${{ github.repository }}/actions/artifacts/${artifact_id}"
64+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/actions/artifacts/${artifact_id}"
6165
fi
6266
done <<< "$artifacts"
6367
done

.github/actions/package-delivery/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ runs:
7777
7878
- if: ${{ inputs.stability != 'stable' }}
7979
name: Restore packages from cache
80-
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
80+
uses: actions/cache/restore@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
8181
with:
8282
path: ./*.${{ steps.parse-distrib.outputs.package_extension }}
8383
key: ${{ inputs.cache_key }}

.github/actions/package-nfpm/action.yml

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -64,29 +64,38 @@ runs:
6464
env:
6565
RPM_GPG_SIGNING_KEY_ID: ${{ inputs.rpm_gpg_signing_key_id }}
6666
RPM_GPG_SIGNING_PASSPHRASE: ${{ inputs.rpm_gpg_signing_passphrase }}
67+
INPUT_VERSION: ${{ inputs.version }}
68+
MAJOR_VERSION: ${{ inputs.major_version }}
69+
MINOR_VERSION: ${{ inputs.minor_version }}
70+
INPUT_RELEASE: ${{ inputs.release }}
71+
ARCH: ${{ inputs.arch }}
72+
PACKAGE_EXTENSION: ${{ inputs.package_extension }}
73+
DISTRIB: ${{ inputs.distrib }}
74+
STABILITY: ${{ inputs.stability }}
75+
PKG_DISTRIB_SEPARATOR: ${{ steps.parse-distrib.outputs.package_distrib_separator }}
76+
PKG_DISTRIB_NAME: ${{ steps.parse-distrib.outputs.package_distrib_name }}
77+
NFPM_FILE_PATTERN: ${{ inputs.nfpm_file_pattern }}
78+
COMMIT_HASH: ${{ inputs.commit_hash }}
6779
run: |
68-
if [ -z ${{ inputs.version }} ]; then
69-
export VERSION="${{ inputs.major_version }}.${{ inputs.minor_version }}"
70-
export MAJOR_VERSION="${{ inputs.major_version }}"
71-
export MINOR_VERSION="${{ inputs.minor_version }}"
72-
elif [ -z ${{ inputs.major_version }} ]; then
73-
export VERSION="${{ inputs.version }}"
80+
if [ -z $INPUT_VERSION ]; then
81+
export VERSION="${MAJOR_VERSION}.${MINOR_VERSION}"
82+
elif [ -z $MAJOR_VERSION ]; then
83+
export VERSION="${INPUT_VERSION}"
7484
export MAJOR_VERSION=$( echo $VERSION | cut -d "-" -f1 )
7585
export MINOR_VERSION=$( echo $VERSION | cut -d "-" -f2 )
7686
fi
77-
export RELEASE="${{ inputs.release }}"
78-
export ARCH="${{ inputs.arch }}"
87+
export RELEASE="${INPUT_RELEASE}"
7988
80-
if [ "${{ inputs.package_extension }}" = "rpm" ]; then
81-
export DIST=".${{ inputs.distrib }}"
89+
if [ "$PACKAGE_EXTENSION" = "rpm" ]; then
90+
export DIST=".$DISTRIB"
8291
export APACHE_USER="apache"
8392
export APACHE_GROUP="apache"
8493
else
8594
export DIST=""
86-
if [ "${{ inputs.stability }}" == "unstable" ] || [ "${{ inputs.stability }}" == "canary" ]; then
87-
export RELEASE="$RELEASE${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }}"
95+
if [ "$STABILITY" == "unstable" ] || [ "$STABILITY" == "canary" ]; then
96+
export RELEASE="$RELEASE${PKG_DISTRIB_SEPARATOR}${PKG_DISTRIB_NAME}"
8897
else
89-
export RELEASE="1${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }}"
98+
export RELEASE="1${PKG_DISTRIB_SEPARATOR}${PKG_DISTRIB_NAME}"
9099
fi
91100
export APACHE_USER="www-data"
92101
export APACHE_GROUP="www-data"
@@ -109,28 +118,28 @@ runs:
109118
export RPM_SIGNING_KEY_ID="$RPM_GPG_SIGNING_KEY_ID"
110119
export NFPM_RPM_PASSPHRASE="$RPM_GPG_SIGNING_PASSPHRASE"
111120
112-
for FILE in ${{ inputs.nfpm_file_pattern }}; do
121+
for FILE in $NFPM_FILE_PATTERN; do
113122
DIRNAME=$(dirname $FILE)
114123
BASENAME=$(basename $FILE)
115124
cd $DIRNAME
116125
sed -i "s/@APACHE_USER@/$APACHE_USER/g" $BASENAME
117126
sed -i "s/@APACHE_GROUP@/$APACHE_GROUP/g" $BASENAME
118-
sed -i "s/@COMMIT_HASH@/${{ inputs.commit_hash }}/g" $BASENAME
119-
nfpm package --config $BASENAME --packager ${{ inputs.package_extension }}
127+
sed -i "s/@COMMIT_HASH@/$COMMIT_HASH/g" $BASENAME
128+
nfpm package --config $BASENAME --packager $PACKAGE_EXTENSION
120129
cd -
121-
mv $DIRNAME/*.${{ inputs.package_extension }} ./
130+
mv $DIRNAME/*.$PACKAGE_EXTENSION ./
122131
done
123132
shell: bash
124133

125-
- uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0
134+
- uses: actions/cache/save@cdf6c1fa76f9f475f3d7449005a359c84ca0f306 # v5.0.3
126135
with:
127136
path: ./*.${{ inputs.package_extension }}
128137
key: ${{ inputs.cache_key }}
129138

130139
# Add to your PR the label upload-artifacts to get packages as artifacts
131140
- if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
132141
name: Upload package artifacts
133-
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
142+
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
134143
with:
135144
name: packages-${{ inputs.distrib }}
136145
path: ./*.${{ inputs.package_extension}}

.github/actions/parse-distrib/action.yml

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,44 +23,51 @@ runs:
2323
steps:
2424
- name: Parse distrib
2525
id: parse-distrib
26+
env:
27+
DISTRIB: ${{ inputs.distrib }}
2628
run: |
27-
if [[ "${{ inputs.distrib }}" == "centos7" || "${{ inputs.distrib }}" == "el7" ]]; then
29+
if [[ "$DISTRIB" == "alma8" || "$DISTRIB" == "el8" ]]; then
2830
PACKAGE_DISTRIB_SEPARATOR="."
29-
PACKAGE_DISTRIB_NAME="el7"
31+
PACKAGE_DISTRIB_NAME="el8"
3032
PACKAGE_EXTENSION="rpm"
3133
DISTRIB_FAMILY="el"
32-
elif [[ "${{ inputs.distrib }}" == "alma8" || "${{ inputs.distrib }}" == "el8" ]]; then
34+
elif [[ "$DISTRIB" == "alma9" || "$DISTRIB" == "el9" ]]; then
3335
PACKAGE_DISTRIB_SEPARATOR="."
34-
PACKAGE_DISTRIB_NAME="el8"
36+
PACKAGE_DISTRIB_NAME="el9"
3537
PACKAGE_EXTENSION="rpm"
3638
DISTRIB_FAMILY="el"
37-
elif [[ "${{ inputs.distrib }}" == "alma9" || "${{ inputs.distrib }}" == "el9" ]]; then
39+
elif [[ "$DISTRIB" == "alma10" || "$DISTRIB" == "el10" ]]; then
3840
PACKAGE_DISTRIB_SEPARATOR="."
39-
PACKAGE_DISTRIB_NAME="el9"
41+
PACKAGE_DISTRIB_NAME="el10"
4042
PACKAGE_EXTENSION="rpm"
4143
DISTRIB_FAMILY="el"
42-
elif [[ "${{ inputs.distrib }}" == "bullseye" ]]; then
44+
elif [[ "$DISTRIB" == "bullseye" ]]; then
4345
PACKAGE_DISTRIB_SEPARATOR="+"
4446
PACKAGE_DISTRIB_NAME="deb11u1"
4547
PACKAGE_EXTENSION="deb"
4648
DISTRIB_FAMILY="debian"
47-
elif [[ "${{ inputs.distrib }}" == "bookworm" ]]; then
49+
elif [[ "$DISTRIB" == "bookworm" ]]; then
4850
PACKAGE_DISTRIB_SEPARATOR="+"
4951
PACKAGE_DISTRIB_NAME="deb12u1"
5052
PACKAGE_EXTENSION="deb"
5153
DISTRIB_FAMILY="debian"
52-
elif [[ "${{ inputs.distrib }}" == "jammy" ]]; then
54+
elif [[ "$DISTRIB" == "trixie" ]]; then
55+
PACKAGE_DISTRIB_SEPARATOR="+"
56+
PACKAGE_DISTRIB_NAME="deb13u1"
57+
PACKAGE_EXTENSION="deb"
58+
DISTRIB_FAMILY="debian"
59+
elif [[ "$DISTRIB" == "jammy" ]]; then
5360
PACKAGE_DISTRIB_SEPARATOR="-"
5461
PACKAGE_DISTRIB_NAME="0ubuntu.22.04"
5562
PACKAGE_EXTENSION="deb"
5663
DISTRIB_FAMILY="ubuntu"
57-
elif [[ "${{ inputs.distrib }}" == "noble" ]]; then
64+
elif [[ "$DISTRIB" == "noble" ]]; then
5865
PACKAGE_DISTRIB_SEPARATOR="-"
5966
PACKAGE_DISTRIB_NAME="0ubuntu.24.04"
6067
PACKAGE_EXTENSION="deb"
6168
DISTRIB_FAMILY="ubuntu"
6269
else
63-
echo "::error::Distrib ${{ inputs.distrib }} cannot be parsed"
70+
echo "::error::Distrib $DISTRIB cannot be parsed"
6471
exit 1
6572
fi
6673
echo "package_distrib_separator=$PACKAGE_DISTRIB_SEPARATOR" >> $GITHUB_OUTPUT

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

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,17 @@ runs:
3030

3131
- name: Promote RPM packages to stable
3232
if: ${{ startsWith(inputs.distrib, 'el') }}
33+
env:
34+
DISTRIB: ${{ inputs.distrib }}
35+
MODULE: ${{ inputs.module }}
36+
STABILITY: ${{ inputs.stability }}
3337
run: |
3438
set -x
35-
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
39+
echo "[DEBUG] - Distrib: $DISTRIB"
3640
3741
for ARCH in "noarch" "x86_64"; do
3842
echo "[DEBUG] - Get path of $ARCH testing artifacts to promote to stable."
39-
SRC_PATHS=$(jf rt s --include-dirs rpm-plugins/${{ inputs.distrib }}/testing/$ARCH/${{ inputs.module }}/*.rpm | jq -r '.[].path')
43+
SRC_PATHS=$(jf rt s --include-dirs rpm-plugins/$DISTRIB/testing/$ARCH/$MODULE/*.rpm | jq -r '.[].path')
4044
4145
if [[ ${SRC_PATHS[@]} ]]; then
4246
for SRC_PATH in ${SRC_PATHS[@]}; do
@@ -48,7 +52,7 @@ runs:
4852
fi
4953
5054
echo "[DEBUG] - Build $ARCH target path."
51-
TARGET_PATH="rpm-plugins/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module }}/"
55+
TARGET_PATH="rpm-plugins/$DISTRIB/$STABILITY/$ARCH/RPMS/$MODULE/"
5256
echo "[DEBUG] - Target path: $TARGET_PATH"
5357
5458
echo "[DEBUG] - Promoting $ARCH testing artifacts to stable."
@@ -66,21 +70,26 @@ runs:
6670
shell: bash
6771

6872
- name: Promote DEB package to stable
69-
if: ${{ contains(fromJSON('["bullseye", "bookworm", "jammy", "noble"]'), inputs.distrib) }}
73+
if: ${{ contains(fromJSON('["bullseye", "bookworm", "trixie", "jammy", "noble"]'), inputs.distrib) }}
74+
env:
75+
DISTRIB: ${{ inputs.distrib }}
76+
MODULE: ${{ inputs.module }}
77+
STABILITY: ${{ inputs.stability }}
78+
PKG_DISTRIB_NAME: ${{ steps.parse-distrib.outputs.package_distrib_name }}
7079
run: |
7180
set -eux
7281
73-
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
74-
echo "[DEBUG] - Distrib: ${{ inputs.module }}"
82+
echo "[DEBUG] - Distrib: $DISTRIB"
83+
echo "[DEBUG] - Distrib: $MODULE"
7584
76-
if [[ "${{ inputs.distrib }}" == "jammy" || "${{ inputs.distrib }}" == "noble" ]]; then
85+
if [[ "$DISTRIB" == "jammy" || "$DISTRIB" == "noble" ]]; then
7786
repo="ubuntu-plugins"
7887
else
7988
repo="apt-plugins"
8089
fi
8190
8291
echo "[DEBUG] - Get path of testing DEB packages to promote to stable."
83-
SRC_PATHS=$(jf rt search --include-dirs $repo-testing/pool/${{ inputs.module }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb | jq -r '.[].path')
92+
SRC_PATHS=$(jf rt search --include-dirs $repo-testing/pool/$MODULE/*${PKG_DISTRIB_NAME}*.deb | jq -r '.[].path')
8493
8594
if [[ ${SRC_PATHS[@]} ]]; then
8695
for SRC_PATH in ${SRC_PATHS[@]}; do
@@ -92,7 +101,7 @@ runs:
92101
fi
93102
94103
echo "[DEBUG] - Build target path."
95-
TARGET_PATH="$repo-${{ inputs.stability }}/pool/${{ inputs.module }}/"
104+
TARGET_PATH="$repo-$STABILITY/pool/$MODULE/"
96105
echo "[DEBUG] - Target path: $TARGET_PATH"
97106
98107
echo "[DEBUG] - Promoting DEB testing artifacts to stable."
@@ -101,10 +110,10 @@ runs:
101110
jf rt download $ARTIFACT --flat
102111
done
103112
104-
for ARTIFACT_DL in $(find . -maxdepth 1 -type f -name '*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb' -printf '%f\n'); do
113+
for ARTIFACT_DL in $(find . -maxdepth 1 -type f -name "*${PKG_DISTRIB_NAME}*.deb" -printf '%f\n'); do
105114
ARCH=$(echo $ARTIFACT_DL | cut -d '_' -f3 | cut -d '.' -f1)
106115
echo "[DEBUG] - Promoting (upload) $ARTIFACT_DL to stable $TARGET_PATH."
107-
jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "${{ inputs.distrib }}/main/$ARCH"
116+
jf rt upload "$ARTIFACT_DL" "$TARGET_PATH" --deb "$DISTRIB/main/$ARCH"
108117
done
109118
rm -f *.deb
110119
shell: bash

.github/actions/release-sources/action.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,22 @@ runs:
3131
shell: bash
3232

3333
- name: Publish on download.centreon.com
34+
env:
35+
MODULE_NAME: ${{ inputs.module_name }}
36+
VERSION: ${{ inputs.version }}
37+
MODULE_DIRECTORY: ${{ inputs.module_directory }}
38+
BUCKET_DIRECTORY: ${{ inputs.bucket_directory }}
39+
TOKEN_DOWNLOAD: ${{ inputs.token_download_centreon_com }}
40+
RELEASE: ${{ inputs.release }}
3441
run: |
35-
SRC_FILE="${{ inputs.module_name }}-${{ inputs.version }}.tar.gz"
42+
SRC_FILE="${MODULE_NAME}-${VERSION}.tar.gz"
3643
37-
mv "${{ inputs.module_directory }}" "${{ inputs.module_name }}-${{ inputs.version }}"
38-
tar czf $SRC_FILE "${{ inputs.module_name }}-${{ inputs.version }}"
44+
mv "$MODULE_DIRECTORY" "${MODULE_NAME}-${VERSION}"
45+
tar czf $SRC_FILE "${MODULE_NAME}-${VERSION}"
3946
4047
SRC_HASH=$(md5sum $SRC_FILE | cut -d ' ' -f 1)
4148
SRC_SIZE=$(stat -c '%s' $SRC_FILE)
4249
43-
aws s3 cp --acl public-read "$SRC_FILE" "s3://centreon-download/public/${{ inputs.bucket_directory }}/$SRC_FILE"
44-
curl --fail "https://download.centreon.com/api/?token=${{ inputs.token_download_centreon_com }}&product=${{ inputs.module_name }}&release=${{ inputs.release }}&version=${{ inputs.version }}&extension=tar.gz&md5=$SRC_HASH&size=$SRC_SIZE&ddos=0&dryrun=0"
50+
aws s3 cp --acl public-read "$SRC_FILE" "s3://centreon-download/public/${BUCKET_DIRECTORY}/$SRC_FILE"
51+
curl --fail "https://download.centreon.com/api/?token=${TOKEN_DOWNLOAD}&product=${MODULE_NAME}&release=${RELEASE}&version=${VERSION}&extension=tar.gz&md5=$SRC_HASH&size=$SRC_SIZE&ddos=0&dryrun=0"
4552
shell: bash

0 commit comments

Comments
 (0)