mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-04-08 17:06:05 +02:00
Compare commits
215 Commits
plugins-20
...
develop
Author | SHA1 | Date | |
---|---|---|---|
|
5822de6cc1 | ||
|
d894389296 | ||
|
23526ce247 | ||
|
59d5ef16d2 | ||
|
eab7a046d2 | ||
|
781dac79b4 | ||
|
d117f13521 | ||
|
5889295b77 | ||
|
edd04d213c | ||
|
5d10adc39b | ||
|
f2142d2485 | ||
|
035e018397 | ||
|
f7b45b2193 | ||
|
b5c5fb4b61 | ||
|
75873668bf | ||
|
82074e5f9e | ||
|
7baab38df6 | ||
|
08e0e04099 | ||
|
92a92c0436 | ||
|
63fa39cde5 | ||
|
65569fe9e0 | ||
|
6de4e7a770 | ||
|
391f77555b | ||
|
480b0b05f8 | ||
|
4a50605c36 | ||
|
4e0df4ca4a | ||
|
6f94314a60 | ||
|
6027943d65 | ||
|
eeac58c17f | ||
|
9a67330f43 | ||
|
7bcde8e753 | ||
|
35ea6cf02f | ||
|
ab9af303e1 | ||
|
5726ad44b3 | ||
|
5da5683f94 | ||
|
c69ef4f5c5 | ||
|
33bf4482a5 | ||
|
800edc6a24 | ||
|
a7b7ac2c53 | ||
|
0634714531 | ||
|
946af281c8 | ||
|
c254a23f77 | ||
|
baf703598e | ||
|
aaf4bb47d6 | ||
|
5a23b681ec | ||
|
1571d4ba18 | ||
|
225180dbe6 | ||
|
1bec397161 | ||
|
8a41d6eb85 | ||
|
653e58f7d0 | ||
|
bfc0eb2541 | ||
|
94d60537a6 | ||
|
5dab3fe02e | ||
|
0d5355cd7d | ||
|
8e66284819 | ||
|
4d055649a3 | ||
|
129256e737 | ||
|
9b5cc956f0 | ||
|
a7d4d51198 | ||
|
148030bf66 | ||
|
4669ded30a | ||
|
ca9e07e13f | ||
|
635401745c | ||
|
9978f5cfcb | ||
|
3fa339ca75 | ||
|
81bcdc4a7e | ||
|
12785e80da | ||
|
e2c193f941 | ||
|
f4d4ccbca5 | ||
|
2aecd211bf | ||
|
1b7b8d7468 | ||
|
295cb0d494 | ||
|
843694df86 | ||
|
48f85e3ba7 | ||
|
0d10876061 | ||
|
d40ae9bb6d | ||
|
cc89be8b3a | ||
|
1e033613f5 | ||
|
8486e3592a | ||
|
471a591596 | ||
|
19ec3f4605 | ||
|
349d5217d6 | ||
|
de31640388 | ||
|
2c868ab9dd | ||
|
4cbb03561f | ||
|
85a30e0394 | ||
|
44f4bd2e14 | ||
|
4ff49c891b | ||
|
869243d19d | ||
|
a4383ffd9e | ||
|
eeb5ee888c | ||
|
f354080ba9 | ||
|
cfc4b4059f | ||
|
e82bdef5a5 | ||
|
18f119bf27 | ||
|
83c6d49206 | ||
|
b9986d6478 | ||
|
3469fc328d | ||
|
5751ee1bfd | ||
|
ee48767a11 | ||
|
4e10376ec7 | ||
|
c6b31bce7d | ||
|
0dae1d9460 | ||
|
9115be2fb1 | ||
|
bae0b56ea9 | ||
|
08e12b1a77 | ||
|
62ca8641f3 | ||
|
26c4b67d28 | ||
|
900717092f | ||
|
9ae01fc81d | ||
|
8ee6889662 | ||
|
3164c6b12c | ||
|
dfda070220 | ||
|
8ad485f423 | ||
|
e34d52c440 | ||
|
f7da012581 | ||
|
47cf7c9e8b | ||
|
942c0b7940 | ||
|
56e8d8c586 | ||
|
accf292b62 | ||
|
7149c95144 | ||
|
137e43eacd | ||
|
0ddcaf9d77 | ||
|
54c92eecca | ||
|
f5f2103295 | ||
|
aa46a1c3c0 | ||
|
046a383192 | ||
|
4dfdfb8158 | ||
|
92473a4b02 | ||
|
bba20e5f12 | ||
|
bedb2be16f | ||
|
b8927e66db | ||
|
f1ab4d9ab1 | ||
|
884c6c22c1 | ||
|
947c1ed11f | ||
|
dedecee5a7 | ||
|
37b8c1ce6f | ||
|
bb1080eb95 | ||
|
8999707edd | ||
|
9e8334caba | ||
|
3953f8dbb5 | ||
|
62f3860136 | ||
|
66bebf3aa6 | ||
|
77ad3ff41a | ||
|
8fe93f0498 | ||
|
eb7ae7fb57 | ||
|
3609bca54b | ||
|
bf2609c709 | ||
|
14b098cb43 | ||
|
0135299c15 | ||
|
5cd19887f2 | ||
|
967acbd935 | ||
|
adf172ccce | ||
|
3227104fdb | ||
|
15bc1661e7 | ||
|
508b2312fc | ||
|
61ea71464e | ||
|
55409b71fd | ||
|
651095a4ea | ||
|
4753f295a5 | ||
|
056589f360 | ||
|
bbbee4bb37 | ||
|
b0e103adce | ||
|
24caa22517 | ||
|
7c63a1a8d0 | ||
|
4c42e0487c | ||
|
69144e3895 | ||
|
2a81f01250 | ||
|
eba027e67c | ||
|
1f9e3b4340 | ||
|
d73866af31 | ||
|
9cee92778f | ||
|
b42a281cdf | ||
|
0bad27bc44 | ||
|
9443665151 | ||
|
80b7a4e819 | ||
|
71eb474970 | ||
|
aa785f3bfd | ||
|
63b30540c0 | ||
|
77237f9fea | ||
|
08695b6f33 | ||
|
8b0c37e79f | ||
|
2a165e1e50 | ||
|
27541845b8 | ||
|
4bf196969c | ||
|
790c96d3ac | ||
|
fe581afd0b | ||
|
3629c94905 | ||
|
39d6d4bbf9 | ||
|
938557e2fd | ||
|
9bac8e5d0c | ||
|
9280037660 | ||
|
abce3cfc94 | ||
|
955aba1d88 | ||
|
feedb1b553 | ||
|
0864756913 | ||
|
f7267b6a7f | ||
|
8bb8d404dd | ||
|
09a2393a63 | ||
|
e7c9f383d9 | ||
|
e331ed5d75 | ||
|
f6cd371443 | ||
|
6515b55841 | ||
|
4fd4942bdf | ||
|
31c2c665fe | ||
|
2249d431b5 | ||
|
af9df10066 | ||
|
b0e8c360f5 | ||
|
2ceae201e9 | ||
|
6ebfc4c46a | ||
|
75e3feb688 | ||
|
e0e55263c0 | ||
|
cc9637ca35 | ||
|
360d09d0f1 | ||
|
9acf1f4075 |
32
.github/CODEOWNERS
vendored
32
.github/CODEOWNERS
vendored
@ -1,22 +1,26 @@
|
||||
* @centreon/owners-connectors
|
||||
* @centreon/owners-connectors
|
||||
|
||||
*.md @centreon/owners-doc
|
||||
*.mdx @centreon/owners-doc
|
||||
*.md @centreon/owners-doc
|
||||
*.mdx @centreon/owners-doc
|
||||
|
||||
*.cmake @centreon/owners-cpp
|
||||
CMakeLists.txt @centreon/owners-cpp
|
||||
Makefile @centreon/owners-cpp
|
||||
*.cmake @centreon/owners-cpp
|
||||
CMakeLists.txt @centreon/owners-cpp
|
||||
Makefile @centreon/owners-cpp
|
||||
|
||||
*.pm @centreon/owners-perl
|
||||
*.pl @centreon/owners-perl
|
||||
*.pm @centreon/owners-perl
|
||||
*.pl @centreon/owners-perl
|
||||
*.t @centreon/owners-perl
|
||||
|
||||
*.py @centreon/owners-python
|
||||
*.py @centreon/owners-python
|
||||
|
||||
*.sh @centreon/owners-bash
|
||||
*.sh @centreon/owners-bash
|
||||
|
||||
tests/** @centreon/owners-robot-e2e
|
||||
tests/** @centreon/owners-robot-e2e
|
||||
|
||||
.github/** @centreon/owners-pipelines
|
||||
packaging/** @centreon/owners-pipelines
|
||||
selinux/** @centreon/owners-pipelines
|
||||
.github/** @centreon/owners-pipelines
|
||||
packaging/** @centreon/owners-perl
|
||||
selinux/** @centreon/owners-pipelines
|
||||
.github/scripts/pod_spell_check.t @centreon/owners-perl
|
||||
|
||||
.gitleaks.toml @centreon/owners-security
|
||||
.gitleaksignore @centreon/owners-security
|
||||
|
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
5
.github/PULL_REQUEST_TEMPLATE.md
vendored
@ -41,7 +41,7 @@ publicly and we'll get in touch with you by private message if this information
|
||||
- [ ] I have provide data or shown output displaying the result of this code in the plugin area concerned.
|
||||
|
||||
------------------------------------------------------------------------------------------------------
|
||||
# Centreon team
|
||||
# Centreon team (internal PR)
|
||||
|
||||
## Description
|
||||
|
||||
@ -75,8 +75,9 @@ Mention the automated tests included in this FOR (what they test like mode/optio
|
||||
- [ ] I have **rebased** my development branch on the base branch (develop).
|
||||
- [ ] In case of a new plugin, I have created the new packaging directory accordingly.
|
||||
- [ ] I have implemented automated tests related to my commits.
|
||||
- [ ] Data used for automated tests are anonymized.
|
||||
- [ ] I have reviewed all the help messages in all the .pm files I have modified.
|
||||
- [ ] All sentences begin with a capital letter.
|
||||
- [ ] All sentences are terminated by a period.
|
||||
- [ ] All sentences end with a period.
|
||||
- [ ] I am able to understand all the help messages, if not, exchange with the PO or TW to rewrite them.
|
||||
- [ ] After having created the PR, I will make sure that all the tests provided in this PR have run and passed.
|
||||
|
49
.github/actions/deb-delivery-legacy/action.yml
vendored
49
.github/actions/deb-delivery-legacy/action.yml
vendored
@ -1,49 +0,0 @@
|
||||
name: "deb-delivery-legacy"
|
||||
description: "Deliver legacy DEB packages"
|
||||
inputs:
|
||||
module_name:
|
||||
description: "The package module name"
|
||||
required: true
|
||||
distrib:
|
||||
description: "The distribution used for packaging"
|
||||
required: true
|
||||
major_version:
|
||||
description: "The major version"
|
||||
required: true
|
||||
cache_key:
|
||||
description: "The cached package key"
|
||||
required: true
|
||||
stability:
|
||||
description: "The package stability (stable, testing, unstable)"
|
||||
required: true
|
||||
artifactory_token:
|
||||
description: "token for artifactory"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Use cache DEB files
|
||||
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
||||
with:
|
||||
path: ./*.deb
|
||||
key: ${{ inputs.cache_key }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
|
||||
env:
|
||||
JF_URL: https://centreon.jfrog.io
|
||||
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
|
||||
|
||||
- name: Publish DEBs to artifactory
|
||||
run: |
|
||||
FILES="*.deb"
|
||||
|
||||
for FILE in $FILES; do
|
||||
echo "[DEBUG] - File: $FILE"
|
||||
|
||||
ARCH=$(echo $FILE | cut -d '_' -f3 | cut -d '.' -f1)
|
||||
|
||||
jf rt upload "$FILE" "apt-standard-${{ inputs.major_version }}-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH"
|
||||
done
|
||||
shell: bash
|
60
.github/actions/deb-delivery/action.yml
vendored
60
.github/actions/deb-delivery/action.yml
vendored
@ -1,60 +0,0 @@
|
||||
name: "deb-delivery"
|
||||
description: "Deliver DEB packages"
|
||||
inputs:
|
||||
module_name:
|
||||
description: "The package module name"
|
||||
required: true
|
||||
distrib:
|
||||
description: "The distribution used for packaging"
|
||||
required: true
|
||||
cache_key:
|
||||
description: "The cached package key"
|
||||
required: true
|
||||
stability:
|
||||
description: "The package stability (stable, testing, unstable)"
|
||||
required: true
|
||||
artifactory_token:
|
||||
description: "token for artifactory"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Remove previously delivered DEBs
|
||||
if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }}
|
||||
run: rm -f ./*.deb
|
||||
shell: bash
|
||||
|
||||
- name: Use cache DEB files
|
||||
if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }}
|
||||
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
||||
with:
|
||||
path: ./*.deb
|
||||
key: ${{ inputs.cache_key }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }}
|
||||
uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
|
||||
env:
|
||||
JF_URL: https://centreon.jfrog.io
|
||||
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
|
||||
|
||||
- name: Publish DEBs to artifactory
|
||||
if: ${{ ! (inputs.distrib == 'jammy' && inputs.stability == 'stable') }}
|
||||
run: |
|
||||
FILES="*.deb"
|
||||
|
||||
if [[ "${{ inputs.distrib }}" == "jammy" ]]; then
|
||||
REPO_PREFIX="ubuntu"
|
||||
else
|
||||
REPO_PREFIX="apt"
|
||||
fi
|
||||
|
||||
for FILE in $FILES; do
|
||||
echo "[DEBUG] - File: $FILE"
|
||||
|
||||
ARCH=$(echo $FILE | cut -d '_' -f3 | cut -d '.' -f1)
|
||||
|
||||
jf rt upload "$FILE" "${REPO_PREFIX}-plugins-${{ inputs.stability }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/$ARCH"
|
||||
done
|
||||
shell: bash
|
4
.github/actions/merge-artifacts/action.yml
vendored
4
.github/actions/merge-artifacts/action.yml
vendored
@ -18,14 +18,14 @@ runs:
|
||||
using: 'composite'
|
||||
steps:
|
||||
- name: Download Artifacts
|
||||
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
|
||||
uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
|
||||
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
|
||||
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: ${{ inputs.target_name }}
|
||||
path: |
|
||||
|
210
.github/actions/package-delivery/action.yml
vendored
Normal file
210
.github/actions/package-delivery/action.yml
vendored
Normal file
@ -0,0 +1,210 @@
|
||||
name: "package-delivery"
|
||||
description: "Deliver packages"
|
||||
inputs:
|
||||
module_name:
|
||||
description: "The package module name"
|
||||
required: true
|
||||
distrib:
|
||||
description: "The distribution used for packaging"
|
||||
required: true
|
||||
arch:
|
||||
description: "The target distribution architecture"
|
||||
required: false
|
||||
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: true
|
||||
artifactory_token:
|
||||
description: "token for artifactory"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Validate inputs
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
if ('${{ inputs.module_name }}' === '') {
|
||||
throw new Error('module_name input must be defined');
|
||||
}
|
||||
|
||||
if (! ['stable', 'testing', 'unstable'].includes('${{ inputs.stability }}')) {
|
||||
throw new Error(`Stability ${{ inputs.stability }} should not deliver packages`);
|
||||
}
|
||||
|
||||
if ('${{ inputs.stability }}' === 'testing' && ! ['release', 'hotfix'].includes('${{ inputs.release_type }}')) {
|
||||
throw new Error('release_type input must be defined when stability is testing');
|
||||
}
|
||||
|
||||
- name: Parse distrib name
|
||||
id: parse-distrib
|
||||
uses: ./.github/actions/parse-distrib
|
||||
with:
|
||||
distrib: ${{ inputs.distrib }}
|
||||
|
||||
- name: Get repository stability path
|
||||
id: get_repository_stability_path
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
let stabilitySubdirectory = '${{ inputs.stability }}';
|
||||
|
||||
if ('${{ inputs.stability }}' === 'testing' && '${{ inputs.release_type }}' === 'hotfix') {
|
||||
stabilitySubdirectory = '${{ inputs.stability }}-${{ inputs.release_type }}';
|
||||
}
|
||||
|
||||
let repositoryStabilityPath = '';
|
||||
if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'el') {
|
||||
repositoryStabilityPath = `rpm-plugins/${{ inputs.distrib }}/${stabilitySubdirectory}`;
|
||||
} else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'ubuntu') {
|
||||
repositoryStabilityPath = `ubuntu-plugins-${{ inputs.stability }}`;
|
||||
} else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'debian') {
|
||||
repositoryStabilityPath = `apt-plugins-${{ inputs.stability }}`;
|
||||
} else {
|
||||
throw new Error(`Repository cannot be find for distribution: ${{ inputs.distrib }}`);
|
||||
}
|
||||
|
||||
core.setOutput(
|
||||
'repository_stability_path',
|
||||
repositoryStabilityPath,
|
||||
);
|
||||
|
||||
- if: ${{ inputs.stability != 'stable' }}
|
||||
name: Restore packages from cache
|
||||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.${{ steps.parse-distrib.outputs.package_extension }}
|
||||
key: ${{ inputs.cache_key }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- uses: jfrog/setup-jfrog-cli@9fe0f98bd45b19e6e931d457f4e98f8f84461fb5 # v4.4.1
|
||||
with:
|
||||
disable-job-summary: true
|
||||
disable-auto-build-publish: true
|
||||
env:
|
||||
JF_URL: https://centreon.jfrog.io
|
||||
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
|
||||
|
||||
- if: ${{ inputs.stability == 'testing' }}
|
||||
name: Clean existing testing packages
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'el') {
|
||||
await exec.exec(
|
||||
`jf rt del "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/*/${{ inputs.module_name }}/*.rpm" --exclusions "*/RPMS/*" --quiet`
|
||||
);
|
||||
} else if ('${{ steps.parse-distrib.outputs.package_extension }}' === 'deb') {
|
||||
await exec.exec(
|
||||
`jf rt del "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/pool/${{ inputs.module_name }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb" --quiet --props "release_type=${{ inputs.release_type }}"`
|
||||
);
|
||||
}
|
||||
|
||||
- name: Download packages from testing
|
||||
if: ${{ inputs.stability == 'stable' && github.event_name == 'push' && (inputs.distrib != 'jammy' || inputs.distrib != 'noble') }}
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const commitSha = context.sha;
|
||||
|
||||
const pulls = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
sort: 'updated',
|
||||
direction: 'desc',
|
||||
state: 'closed',
|
||||
per_page: 100
|
||||
});
|
||||
|
||||
core.startGroup(`Checking pull request linked to commit ${commitSha}`);
|
||||
const pr = pulls.data.find(p => {
|
||||
console.log(`Checking pull request ${p.number}("${p.title}") with merge commit ${p.merge_commit_sha}`);
|
||||
return p.merge_commit_sha === commitSha;
|
||||
});
|
||||
core.endGroup();
|
||||
if (!pr) {
|
||||
core.error(`No pull request found for merge commit ${commitSha}`);
|
||||
return;
|
||||
}
|
||||
|
||||
const prHeadRef = pr?.head?.ref || 'unknown';
|
||||
let releaseType = '';
|
||||
switch (true) {
|
||||
case /^release.+/.test(prHeadRef):
|
||||
releaseType = 'release';
|
||||
break;
|
||||
case /^hotfix.+/.test(prHeadRef):
|
||||
releaseType = 'hotfix';
|
||||
break;
|
||||
default:
|
||||
core.error(`No packages are promoted because push of branch ${prHeadRef} is not related to a hotfix/release pull request.`);
|
||||
return;
|
||||
}
|
||||
console.log(`Release type: ${releaseType}`);
|
||||
|
||||
let fromStabilitySubdirectory = 'testing';
|
||||
if (releaseType === 'hotfix' ) {
|
||||
fromStabilitySubdirectory = `testing-${releaseType}`;
|
||||
}
|
||||
|
||||
if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'el') {
|
||||
await exec.exec(
|
||||
`jf rt download "rpm-plugins/${{ inputs.distrib }}/${fromStabilitySubdirectory}/*/${{ inputs.module_name }}/*.rpm" --flat`
|
||||
);
|
||||
} else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'ubuntu') {
|
||||
await exec.exec(
|
||||
`jf rt download "ubuntu-plugins-testing/pool/${{ inputs.module_name }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb" --props "release_type=${releaseType}" --flat`
|
||||
);
|
||||
} else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'debian') {
|
||||
await exec.exec(
|
||||
`jf rt download "apt-plugins-testing/pool/${{ inputs.module_name }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb" --props "release_type=${releaseType}" --flat`
|
||||
);
|
||||
}
|
||||
|
||||
- name: Publish packages to ${{ inputs.stability }}
|
||||
if: |
|
||||
contains(fromJson('["testing", "unstable"]'), inputs.stability) ||
|
||||
(inputs.stability == 'stable' && github.event_name == 'push' && (inputs.distrib != 'jammy' || inputs.distrib != 'noble'))
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const path = require('path');
|
||||
const globber = await glob.create('*.${{ steps.parse-distrib.outputs.package_extension }}');
|
||||
|
||||
let stableRpmSubdirectory = '';
|
||||
if ('${{ inputs.stability }}' === 'stable') {
|
||||
stableRpmSubdirectory = 'RPMS/';
|
||||
}
|
||||
|
||||
const debTargetProps = '${{ inputs.stability }}' == 'testing' ? '--target-props "release_type=${{ inputs.release_type }}"' : '';
|
||||
|
||||
for await (const file of globber.globGenerator()) {
|
||||
const fileName = path.basename(file);
|
||||
|
||||
if ('${{ steps.parse-distrib.outputs.package_extension }}' === 'rpm') {
|
||||
let arch = 'noarch';
|
||||
if (/x86_64/.test(fileName)) {
|
||||
arch = 'x86_64';
|
||||
}
|
||||
await exec.exec(
|
||||
`jf rt upload "${fileName}" "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/${arch}/${stableRpmSubdirectory}${{ inputs.module_name }}/" --flat`
|
||||
);
|
||||
} else if ('${{ steps.parse-distrib.outputs.package_extension }}' === 'deb') {
|
||||
let arch = 'all';
|
||||
const matches = fileName.match(/_([^_]+)\.deb/);
|
||||
if (matches !== null && matches.length > 1) {
|
||||
arch = matches[1];
|
||||
}
|
||||
if ('${{ inputs.arch }}' === '' || '${{ inputs.arch }}' === arch) {
|
||||
await exec.exec(
|
||||
`jf rt upload "${fileName}" "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/pool/${{ inputs.module_name }}/" --deb "${{ inputs.distrib }}/main/${arch}" ${debTargetProps} --flat`
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
17
.github/actions/package-nfpm/action.yml
vendored
17
.github/actions/package-nfpm/action.yml
vendored
@ -48,12 +48,6 @@ runs:
|
||||
using: composite
|
||||
|
||||
steps:
|
||||
- name: Remove previously packaged DEBs and RPMs
|
||||
run: |
|
||||
rm -f ./*.deb
|
||||
rm -f ./*.rpm
|
||||
shell: bash
|
||||
|
||||
- name: Parse distrib name
|
||||
id: parse-distrib
|
||||
uses: ./.github/actions/parse-distrib
|
||||
@ -128,14 +122,7 @@ runs:
|
||||
done
|
||||
shell: bash
|
||||
|
||||
- if: ${{ inputs.distrib == 'el7' }}
|
||||
uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
|
||||
with:
|
||||
path: ./*.${{ inputs.package_extension }}
|
||||
key: ${{ inputs.cache_key }}
|
||||
|
||||
- if: ${{ inputs.distrib != 'el7' }}
|
||||
uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.${{ inputs.package_extension }}
|
||||
key: ${{ inputs.cache_key }}
|
||||
@ -143,7 +130,7 @@ runs:
|
||||
# Add to your PR the label upload-artifacts to get packages as artifacts
|
||||
- if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
|
||||
name: Upload package artifacts
|
||||
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
|
||||
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: packages-${{ inputs.distrib }}
|
||||
path: ./*.${{ inputs.package_extension}}
|
||||
|
26
.github/actions/parse-distrib/action.yml
vendored
26
.github/actions/parse-distrib/action.yml
vendored
@ -11,6 +11,12 @@ outputs:
|
||||
package_distrib_name:
|
||||
description: "Distribution suffix in package name"
|
||||
value: ${{ steps.parse-distrib.outputs.package_distrib_name }}
|
||||
package_extension:
|
||||
description: "Package extension (rpm or deb)"
|
||||
value: ${{ steps.parse-distrib.outputs.package_extension }}
|
||||
distrib_family:
|
||||
description: "Distrib family (el, debian, ubuntu)"
|
||||
value: ${{ steps.parse-distrib.outputs.distrib_family }}
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
@ -21,26 +27,44 @@ runs:
|
||||
if [[ "${{ inputs.distrib }}" == "centos7" || "${{ inputs.distrib }}" == "el7" ]]; then
|
||||
PACKAGE_DISTRIB_SEPARATOR="."
|
||||
PACKAGE_DISTRIB_NAME="el7"
|
||||
PACKAGE_EXTENSION="rpm"
|
||||
DISTRIB_FAMILY="el"
|
||||
elif [[ "${{ inputs.distrib }}" == "alma8" || "${{ inputs.distrib }}" == "el8" ]]; then
|
||||
PACKAGE_DISTRIB_SEPARATOR="."
|
||||
PACKAGE_DISTRIB_NAME="el8"
|
||||
PACKAGE_EXTENSION="rpm"
|
||||
DISTRIB_FAMILY="el"
|
||||
elif [[ "${{ inputs.distrib }}" == "alma9" || "${{ inputs.distrib }}" == "el9" ]]; then
|
||||
PACKAGE_DISTRIB_SEPARATOR="."
|
||||
PACKAGE_DISTRIB_NAME="el9"
|
||||
PACKAGE_EXTENSION="rpm"
|
||||
DISTRIB_FAMILY="el"
|
||||
elif [[ "${{ inputs.distrib }}" == "bullseye" ]]; then
|
||||
PACKAGE_DISTRIB_SEPARATOR="+"
|
||||
PACKAGE_DISTRIB_NAME="deb11u1"
|
||||
PACKAGE_EXTENSION="deb"
|
||||
DISTRIB_FAMILY="debian"
|
||||
elif [[ "${{ inputs.distrib }}" == "bookworm" ]]; then
|
||||
PACKAGE_DISTRIB_SEPARATOR="+"
|
||||
PACKAGE_DISTRIB_NAME="deb12u1"
|
||||
PACKAGE_EXTENSION="deb"
|
||||
DISTRIB_FAMILY="debian"
|
||||
elif [[ "${{ inputs.distrib }}" == "jammy" ]]; then
|
||||
PACKAGE_DISTRIB_SEPARATOR="-"
|
||||
PACKAGE_DISTRIB_NAME="0ubuntu.22.04"
|
||||
PACKAGE_EXTENSION="deb"
|
||||
DISTRIB_FAMILY="ubuntu"
|
||||
elif [[ "${{ inputs.distrib }}" == "noble" ]]; then
|
||||
PACKAGE_DISTRIB_SEPARATOR="-"
|
||||
PACKAGE_DISTRIB_NAME="0ubuntu.24.04"
|
||||
PACKAGE_EXTENSION="deb"
|
||||
DISTRIB_FAMILY="ubuntu"
|
||||
else
|
||||
echo "::error::Distrib ${{ inputs.distrib }} cannot be parsed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
echo "package_distrib_separator=$PACKAGE_DISTRIB_SEPARATOR" >> $GITHUB_OUTPUT
|
||||
echo "package_distrib_name=$PACKAGE_DISTRIB_NAME" >> $GITHUB_OUTPUT
|
||||
echo "package_extension=$PACKAGE_EXTENSION" >> $GITHUB_OUTPUT
|
||||
echo "distrib_family=$DISTRIB_FAMILY" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
12
.github/actions/promote-to-stable/action.yml
vendored
12
.github/actions/promote-to-stable/action.yml
vendored
@ -66,15 +66,21 @@ runs:
|
||||
shell: bash
|
||||
|
||||
- name: Promote DEB package to stable
|
||||
if: ${{ contains(fromJSON('["bullseye", "bookworm"]'), inputs.distrib) }}
|
||||
if: ${{ contains(fromJSON('["bullseye", "bookworm", "jammy", "noble"]'), inputs.distrib) }}
|
||||
run: |
|
||||
set -eux
|
||||
|
||||
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
|
||||
echo "[DEBUG] - Distrib: ${{ inputs.module }}"
|
||||
|
||||
if [[ "${{ inputs.distrib }}" == "jammy" || "${{ inputs.distrib }}" == "noble" ]]; then
|
||||
repo="ubuntu-plugins"
|
||||
else
|
||||
repo="apt-plugins"
|
||||
fi
|
||||
|
||||
echo "[DEBUG] - Get path of testing DEB packages to promote to stable."
|
||||
SRC_PATHS=$(jf rt search --include-dirs apt-plugins-testing/pool/${{ inputs.module }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb | jq -r '.[].path')
|
||||
SRC_PATHS=$(jf rt search --include-dirs $repo-testing/pool/${{ inputs.module }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb | jq -r '.[].path')
|
||||
|
||||
if [[ ${SRC_PATHS[@]} ]]; then
|
||||
for SRC_PATH in ${SRC_PATHS[@]}; do
|
||||
@ -86,7 +92,7 @@ runs:
|
||||
fi
|
||||
|
||||
echo "[DEBUG] - Build target path."
|
||||
TARGET_PATH="apt-plugins-${{ inputs.stability }}/pool/${{ inputs.module }}/"
|
||||
TARGET_PATH="$repo-${{ inputs.stability }}/pool/${{ inputs.module }}/"
|
||||
echo "[DEBUG] - Target path: $TARGET_PATH"
|
||||
|
||||
echo "[DEBUG] - Promoting DEB testing artifacts to stable."
|
||||
|
75
.github/actions/rpm-delivery-legacy/action.yml
vendored
75
.github/actions/rpm-delivery-legacy/action.yml
vendored
@ -1,75 +0,0 @@
|
||||
name: "rpm-delivery-legacy"
|
||||
description: "rpm delivery in legacy repositories"
|
||||
inputs:
|
||||
module_name:
|
||||
description: "The package module name"
|
||||
required: true
|
||||
major_version:
|
||||
description: "The major version"
|
||||
required: true
|
||||
distrib:
|
||||
description: "The distribution used for packaging"
|
||||
required: true
|
||||
cache_key:
|
||||
description: "The cached package key"
|
||||
required: true
|
||||
stability:
|
||||
description: "The package stability (stable, testing, unstable)"
|
||||
required: true
|
||||
artifactory_token:
|
||||
description: "token for artifactory"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Use cache RPM files
|
||||
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
||||
with:
|
||||
path: ./*.rpm
|
||||
key: ${{ inputs.cache_key }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
|
||||
env:
|
||||
JF_URL: https://centreon.jfrog.io
|
||||
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
|
||||
|
||||
- name: Publish RPMs to standard repository
|
||||
run: |
|
||||
FILES="*.rpm"
|
||||
|
||||
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
|
||||
|
||||
if [ -z "${{ inputs.module_name }}" ]; then
|
||||
echo "::error::Module name is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${{ inputs.distrib }}" ]; then
|
||||
echo "::error::Distrib is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir noarch x86_64
|
||||
|
||||
for FILE in $FILES; do
|
||||
echo "[DEBUG] - File: $FILE"
|
||||
|
||||
ARCH=$(echo $FILE | grep -oP '(x86_64|noarch)')
|
||||
|
||||
echo "[DEBUG] - Arch: $ARCH"
|
||||
|
||||
cp "$FILE" "$ARCH"
|
||||
done
|
||||
|
||||
for ARCH in "noarch" "x86_64"; do
|
||||
if [ "$(ls -A $ARCH)" ]; then
|
||||
if [ "${{ inputs.stability }}" == "stable" ]; then
|
||||
jf rt upload "$ARCH/*.rpm" "rpm-standard/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/" --flat
|
||||
else
|
||||
jf rt upload "$ARCH/*.rpm" "rpm-standard/${{ inputs.major_version }}/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --flat
|
||||
fi
|
||||
fi
|
||||
done
|
||||
shell: bash
|
77
.github/actions/rpm-delivery/action.yml
vendored
77
.github/actions/rpm-delivery/action.yml
vendored
@ -1,77 +0,0 @@
|
||||
name: "rpm-delivery"
|
||||
description: "rpm delivery"
|
||||
inputs:
|
||||
module_name:
|
||||
description: "The package module name"
|
||||
required: true
|
||||
distrib:
|
||||
description: "The distribution used for packaging"
|
||||
required: true
|
||||
cache_key:
|
||||
description: "The cached package key"
|
||||
required: true
|
||||
stability:
|
||||
description: "The package stability (stable, testing, unstable)"
|
||||
required: true
|
||||
artifactory_token:
|
||||
description: "token for artifactory"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
- name: Remove previously delivered RPMs
|
||||
run: rm -f ./*.rpm
|
||||
shell: bash
|
||||
|
||||
- name: Use cache RPM files
|
||||
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
||||
with:
|
||||
path: ./*.rpm
|
||||
key: ${{ inputs.cache_key }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- uses: jfrog/setup-jfrog-cli@26da2259ee7690e63b5410d7451b2938d08ce1f9 # v4.0.0
|
||||
env:
|
||||
JF_URL: https://centreon.jfrog.io
|
||||
JF_ACCESS_TOKEN: ${{ inputs.artifactory_token }}
|
||||
|
||||
- name: Publish RPMs to plugins repository
|
||||
run: |
|
||||
FILES="*.rpm"
|
||||
|
||||
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
|
||||
|
||||
if [ -z "${{ inputs.module_name }}" ]; then
|
||||
echo "module name is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "${{ inputs.distrib }}" ]; then
|
||||
echo "distrib is required"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
rm -rf noarch x86_64
|
||||
mkdir noarch x86_64
|
||||
|
||||
for FILE in $FILES; do
|
||||
echo "[DEBUG] - File: $FILE"
|
||||
|
||||
ARCH=$(echo $FILE | grep -oP '(x86_64|noarch)')
|
||||
|
||||
echo "[DEBUG] - Arch: $ARCH"
|
||||
|
||||
cp "$FILE" "$ARCH"
|
||||
done
|
||||
|
||||
for ARCH in "noarch" "x86_64"; do
|
||||
if [ "$(ls -A $ARCH)" ]; then
|
||||
if [ "${{ inputs.stability }}" == "stable" ]; then
|
||||
jf rt upload "$ARCH/*.rpm" "rpm-plugins/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/RPMS/${{ inputs.module_name }}/" --flat
|
||||
else
|
||||
jf rt upload "$ARCH/*.rpm" "rpm-plugins/${{ inputs.distrib }}/${{ inputs.stability }}/$ARCH/${{ inputs.module_name }}/" --flat
|
||||
fi
|
||||
fi
|
||||
done
|
||||
shell: bash
|
141
.github/actions/test-cpan-libs/action.yml
vendored
Normal file
141
.github/actions/test-cpan-libs/action.yml
vendored
Normal file
@ -0,0 +1,141 @@
|
||||
name: "test-cpan-libs"
|
||||
description: "Test packaged CPAN libraries"
|
||||
inputs:
|
||||
package_extension:
|
||||
description: "The package extension (deb or rpm)"
|
||||
required: true
|
||||
distrib:
|
||||
description: "The distribution name"
|
||||
required: true
|
||||
arch:
|
||||
description: "The architecture (amd64 or arm64)"
|
||||
required: true
|
||||
|
||||
runs:
|
||||
using: "composite"
|
||||
steps:
|
||||
|
||||
- if: ${{ inputs.package_extension == 'rpm' }}
|
||||
name: Install zstd, perl and Centreon repositories
|
||||
run: |
|
||||
dnf install -y zstd perl epel-release 'dnf-command(config-manager)' perl-App-cpanminus
|
||||
dnf config-manager --set-enabled powertools || true # alma 8
|
||||
dnf config-manager --set-enabled crb || true # alma 9
|
||||
# Import Centreon GPG key
|
||||
GPG_KEY_URL="https://yum-gpg.centreon.com/RPM-GPG-KEY-CES"
|
||||
curl -sSL $GPG_KEY_URL -o RPM-GPG-KEY-CES
|
||||
rpm --import RPM-GPG-KEY-CES
|
||||
shell: bash
|
||||
|
||||
- if: ${{ inputs.package_extension == 'deb' }}
|
||||
name: Install zstd, perl and Centreon repositories
|
||||
run: |
|
||||
export DEBIAN_FRONTEND=noninteractive
|
||||
apt-get update
|
||||
apt-get install -y zstd perl wget gpg apt-utils procps build-essential cpanminus
|
||||
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
|
||||
# Avoid apt to clean packages cache directory
|
||||
rm -f /etc/apt/apt.conf.d/docker-clean
|
||||
apt-get update
|
||||
shell: bash
|
||||
|
||||
- name: Restore packages from cache
|
||||
uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0
|
||||
with:
|
||||
path: ./*.${{ inputs.package_extension }}
|
||||
key: ${{ github.sha }}-${{ github.run_id }}-${{ inputs.package_extension }}-${{ inputs.distrib }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- if: ${{ inputs.package_extension == 'rpm' }}
|
||||
name: Check packages installation / uninstallation
|
||||
run: |
|
||||
error_log="install_error_${{ inputs.distrib }}_${{ inputs.arch }}.log"
|
||||
for package in ./*.rpm; do
|
||||
echo "Installing package: $package"
|
||||
# List dependencies, and remove version and comparison operators
|
||||
dependencies=$(rpm -qpR $package | sed 's/ [0-9.-]*\(\s\|$\)/ /g' | sed 's/ [<>!=]*\(\s\|$\)/ /g')
|
||||
for dependency in $dependencies; do
|
||||
# Skip non-perl dependencies
|
||||
if [[ $dependency != perl* ]]; then
|
||||
continue
|
||||
else
|
||||
echo "Check dependency: $dependency"
|
||||
# Update the dependency name to match the package name
|
||||
dependency=$(echo $dependency | sed 's/(/-/g' | sed 's/)//g' | sed 's/::/-/g')
|
||||
fi
|
||||
# If the dependency has been built in the same workflow, install it
|
||||
if [[ -n $(find . -maxdepth 1 -regex "\.\/$dependency-[0-9v].*\.rpm") ]]; then
|
||||
echo "Installing dependency: $dependency"
|
||||
error_output=$(dnf install -y ./$dependency*.rpm 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the dependency $dependency" >> $error_log; true; }
|
||||
fi
|
||||
done
|
||||
# Install package, then uninstall it with all his dependencies
|
||||
echo "Package installation..."
|
||||
error_output=$(dnf install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
|
||||
echo "Package installation done."
|
||||
script_name=$(echo $package | tr '[:upper:]' '[:lower:]' | sed 's/\.\/perl-//' | sed 's/-[0-9\.-]*.el[0-9]..*.rpm//')
|
||||
if [[ -f ./tests/cpan-libraries/$script_name.pl ]]; then
|
||||
echo "Testing package..."
|
||||
error_output=$(perl tests/cpan-libraries/$script_name.pl 2>&1) || { echo "$error_output" >> $error_log; echo "Error during the usage test of the package $package" >> $error_log; true; }
|
||||
echo "Testing done."
|
||||
else
|
||||
echo "No test script found for the package $package"
|
||||
fi
|
||||
echo "Package uninstallation..."
|
||||
error_output=$(dnf autoremove --setopt=keepcache=True -y $(echo $package | sed 's/_[0-9].*\.rpm//' | sed 's/.\///') 2>&1) || { echo "$error_output" >> $error_log; echo "Error during autoremove of the package $package" >> $error_log; true; }
|
||||
echo "Package uninstallation done."
|
||||
done
|
||||
# If the file error_log exists and is not empty, the workflow is in error
|
||||
if [[ -s $error_log ]]; then
|
||||
cat $error_log
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
- if: ${{ inputs.package_extension == 'deb' }}
|
||||
name: Check packages installation / uninstallation
|
||||
run: |
|
||||
error_log="install_error_${{ inputs.distrib }}_${{ inputs.arch }}.log"
|
||||
for package in ./*.deb; do
|
||||
# If the debian package name ends with amd64 or arm64, we only install it if the tested architecture is the same, otherwise we skip it
|
||||
if [[ $package == *amd64.deb && ${{ inputs.arch }} != "amd64" || $package == *arm64.deb && ${{ inputs.arch }} != "arm64" ]]; then
|
||||
continue
|
||||
fi
|
||||
echo "Installing package: $package"
|
||||
# List dependencies
|
||||
dependencies=$(dpkg-deb -I $package | grep Depends | sed 's/Depends: //' | sed 's/,//g' | sed 's/(\(.*\)//g') || { echo "$error_output" >> $error_log; echo "Error while listing dependencies of the package $package" >> $error_log; true; }
|
||||
for dependency in $dependencies; do
|
||||
# If the dependency exists in the Debian repository, don't check the local dependencies
|
||||
dependency_info=$(apt-cache policy $dependency)
|
||||
if [[ -n $dependency_info ]]; then
|
||||
echo "Dependency $dependency exists in debian repository."
|
||||
else
|
||||
# If the dependency has been built in the same workflow, install it
|
||||
for dependency_package in $(find . -maxdepth 1 -regex "\.\/${dependency}_[0-9].*all\.deb" -o -regex "\.\/${dependency}_[0-9].*${{ inputs.arch }}\.deb"); do
|
||||
echo "Installing dependency: $dependency_package"
|
||||
error_output=$(apt-get install -y ./$dependency_package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the dependency $dependency" >> $error_log; true; }
|
||||
done
|
||||
fi
|
||||
done
|
||||
# Install package, then uninstall it with all his dependencies
|
||||
echo "Package installation..."
|
||||
error_output=$(apt-get install -y $package 2>&1) || { echo "$error_output" >> $error_log; echo "Error during installation of the package $package" >> $error_log; true; }
|
||||
echo "Package installation done."
|
||||
script_name=$(echo $package | sed 's/.\/lib//' | sed 's/-perl_[0-9\.-]*-deb.*\.deb//')
|
||||
if [[ -f ./tests/cpan-libraries/$script_name.pl ]]; then
|
||||
echo "Testing package..."
|
||||
error_output=$(perl tests/cpan-libraries/$script_name.pl 2>&1) || { echo "$error_output" >> $error_log; echo "Error during the usage test of the package $package" >> $error_log; true; }
|
||||
echo "Testing done."
|
||||
else
|
||||
echo "No test script found for the package $package"
|
||||
fi
|
||||
echo "Package uninstallation..."
|
||||
error_output=$(apt-get autoremove -y --purge $(echo $package | sed 's/_[0-9].*\.deb//' | sed 's/.\///') 2>&1) || { echo "$error_output" >> $error_log; echo "Error during autoremove of the package $package" >> $error_log; true; }
|
||||
echo "Package uninstallation done."
|
||||
done
|
||||
# If the file error_log exists and is not empty, the workflow is in error
|
||||
if [[ -s $error_log ]]; then
|
||||
cat $error_log
|
||||
exit 1
|
||||
fi
|
||||
shell: bash
|
6
.github/actions/test-plugins/action.yml
vendored
6
.github/actions/test-plugins/action.yml
vendored
@ -16,7 +16,7 @@ runs:
|
||||
steps:
|
||||
|
||||
- name: get the cached plugin
|
||||
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
||||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.${{ inputs.package-extension }}
|
||||
key: ${{ inputs.cache-key }}
|
||||
@ -24,4 +24,6 @@ runs:
|
||||
|
||||
- name: Install, test and remove plugin
|
||||
shell: bash
|
||||
run: python3 .github/scripts/test-all-plugins.py ${{ inputs.package-extension }} ${{ inputs.plugin-list }}
|
||||
run: |
|
||||
[[ -f /.venv/bin/activate ]] && source /.venv/bin/activate
|
||||
python3 .github/scripts/test-all-plugins.py ${{ inputs.package-extension }} ${{ inputs.plugin-list }}
|
||||
|
2
.github/dependabot.yml
vendored
2
.github/dependabot.yml
vendored
@ -4,7 +4,7 @@ updates:
|
||||
directory: '/'
|
||||
schedule:
|
||||
interval: monthly
|
||||
open-pull-requests-limit: 10
|
||||
open-pull-requests-limit: 50
|
||||
labels:
|
||||
- 'dependencies'
|
||||
- 'gha'
|
||||
|
@ -10,10 +10,22 @@ baseurl=https://repo.goreleaser.com/yum/
|
||||
enabled=1
|
||||
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo
|
||||
|
||||
dnf -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm openssl-devel jq zstd selinux-policy-devel
|
||||
dnf -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm-2.41.0 openssl-devel jq zstd selinux-policy-devel yum-utils
|
||||
dnf config-manager --set-enabled powertools
|
||||
dnf -y install perl-App-cpanminus perl-JSON
|
||||
cpanm App::FatPacker
|
||||
cpanm File::Copy::Recursive
|
||||
|
||||
# For cpan libs
|
||||
dnf install -y cpio libcurl-devel libssh-devel expat-devel libuuid-devel zeromq-devel libxml2-devel libffi-devel perl-DBI perl-Net-Pcap freetds freetds-devel perl-Module-Build-Tiny
|
||||
cpanm Module::Build::Tiny
|
||||
cpanm Module::Install
|
||||
# Install fpm (ruby 3 is required)
|
||||
dnf module reset -y ruby
|
||||
dnf module enable -y ruby:3.1
|
||||
dnf install -y ruby ruby-devel
|
||||
gem install fpm
|
||||
|
||||
dnf clean all
|
||||
|
||||
EOF
|
||||
|
@ -10,10 +10,22 @@ baseurl=https://repo.goreleaser.com/yum/
|
||||
enabled=1
|
||||
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo
|
||||
|
||||
dnf -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm openssl-devel jq zstd selinux-policy-devel
|
||||
dnf -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm-2.41.0 openssl-devel jq zstd selinux-policy-devel yum-utils
|
||||
dnf config-manager --set-enabled crb
|
||||
dnf -y install perl-App-cpanminus perl-JSON
|
||||
cpanm App::FatPacker
|
||||
cpanm File::Copy::Recursive
|
||||
|
||||
# For cpan libs
|
||||
dnf install -y cpio libcurl-devel libssh-devel expat-devel libuuid-devel zeromq-devel libxml2-devel libffi-devel perl-DBI perl-Net-Pcap freetds freetds-devel perl-Module-Build-Tiny
|
||||
cpanm Module::Build::Tiny
|
||||
cpanm Module::Install
|
||||
# Install fpm (ruby 3 is required)
|
||||
dnf module reset -y ruby
|
||||
dnf module enable -y ruby:3.1
|
||||
dnf install -y ruby ruby-devel
|
||||
gem install fpm
|
||||
|
||||
dnf clean all
|
||||
|
||||
EOF
|
||||
|
@ -55,12 +55,18 @@ apt-get install -y \
|
||||
|
||||
cpanm Module::Build::Tiny
|
||||
cpanm Module::Install
|
||||
cpanm Crypt::OpenSSL::Guess
|
||||
|
||||
gem install fpm
|
||||
|
||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||
apt-get update
|
||||
apt-get install -y nfpm
|
||||
apt-get install -y nfpm=2.41.0
|
||||
|
||||
apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
COPY .github/patch/fpm-deb.rb.diff /tmp/fpm-deb.rb.diff
|
||||
# Patch to apply fpm fix for debian package generation while waiting for the official fix to be released (https://github.com/jordansissel/fpm/pull/1947).
|
||||
RUN patch -i /tmp/fpm-deb.rb.diff $(find / -type f -name "deb.rb") && /bin/rm -rf /tmp/fpm-deb.rb.diff
|
||||
|
@ -38,7 +38,6 @@ apt-get install -y \
|
||||
libapp-fatpacker-perl \
|
||||
libcurl4-openssl-dev \
|
||||
libczmq-dev \
|
||||
libczmq-dev\
|
||||
libfile-copy-recursive-perl \
|
||||
libjson-perl \
|
||||
libmodule-build-tiny-perl \
|
||||
@ -58,11 +57,14 @@ cpanm Crypt::OpenSSL::Guess
|
||||
|
||||
gem install fpm
|
||||
|
||||
|
||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||
apt-get update
|
||||
apt-get install -y nfpm
|
||||
apt-get install -y nfpm=2.41.0
|
||||
|
||||
apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
COPY .github/patch/fpm-deb.rb.diff /tmp/fpm-deb.rb.diff
|
||||
# Patch to apply fpm fix for debian package generation while waiting for the official fix to be released (https://github.com/jordansissel/fpm/pull/1947).
|
||||
RUN patch -i /tmp/fpm-deb.rb.diff $(find / -type f -name "deb.rb") && /bin/rm -rf /tmp/fpm-deb.rb.diff
|
||||
|
@ -1,19 +0,0 @@
|
||||
ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/centos:7
|
||||
|
||||
RUN bash -e <<EOF
|
||||
|
||||
echo '[goreleaser]
|
||||
name=GoReleaser
|
||||
baseurl=https://repo.goreleaser.com/yum/
|
||||
enabled=1
|
||||
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo
|
||||
|
||||
yum -y install git gettext rpm-build dos2unix python3 epel-release nfpm
|
||||
yum -y install perl-App-FatPacker perl-File-Copy-Recursive perl-JSON jq zstd
|
||||
yum clean all
|
||||
|
||||
EOF
|
||||
|
||||
WORKDIR /src
|
@ -61,8 +61,12 @@ gem install fpm
|
||||
|
||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||
apt-get update
|
||||
apt-get install -y nfpm
|
||||
apt-get install -y nfpm=2.41.0
|
||||
|
||||
apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
COPY .github/patch/fpm-deb.rb.diff /tmp/fpm-deb.rb.diff
|
||||
# Patch to apply fpm fix for debian package generation while waiting for the official fix to be released (https://github.com/jordansissel/fpm/pull/1947).
|
||||
RUN patch -i /tmp/fpm-deb.rb.diff $(find / -type f -name "deb.rb") && /bin/rm -rf /tmp/fpm-deb.rb.diff
|
||||
|
@ -6,9 +6,9 @@ RUN bash -e <<EOF
|
||||
|
||||
dnf install -y \
|
||||
git \
|
||||
java-17-openjdk-devel \
|
||||
wget \
|
||||
zstd \
|
||||
https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm
|
||||
zstd
|
||||
|
||||
cd /usr/local/src
|
||||
wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
|
||||
@ -21,7 +21,7 @@ name=GoReleaser
|
||||
baseurl=https://repo.goreleaser.com/yum/
|
||||
enabled=1
|
||||
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo
|
||||
dnf install -y nfpm
|
||||
dnf install -y nfpm-2.41.0
|
||||
dnf clean all
|
||||
|
||||
EOF
|
||||
|
@ -6,9 +6,9 @@ RUN bash -e <<EOF
|
||||
|
||||
dnf install -y \
|
||||
git \
|
||||
java-17-openjdk-devel \
|
||||
wget \
|
||||
zstd \
|
||||
https://download.oracle.com/java/17/latest/jdk-17_linux-x64_bin.rpm
|
||||
zstd
|
||||
|
||||
cd /usr/local/src
|
||||
wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
|
||||
@ -21,7 +21,7 @@ name=GoReleaser
|
||||
baseurl=https://repo.goreleaser.com/yum/
|
||||
enabled=1
|
||||
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo
|
||||
dnf install -y nfpm
|
||||
dnf install -y nfpm-2.41.0
|
||||
dnf clean all
|
||||
|
||||
EOF
|
||||
|
@ -8,14 +8,14 @@ apt-get update
|
||||
apt-get install -y \
|
||||
ca-certificates \
|
||||
git \
|
||||
zstd \
|
||||
maven=3.8.7-1 \
|
||||
openjdk-17-jdk
|
||||
openjdk-17-jdk \
|
||||
zstd
|
||||
|
||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||
|
||||
apt-get update
|
||||
apt-get install -y nfpm
|
||||
apt-get install -y nfpm=2.41.0
|
||||
|
||||
apt-get clean all
|
||||
|
||||
|
@ -8,14 +8,14 @@ apt-get update
|
||||
apt-get install -y \
|
||||
ca-certificates \
|
||||
git \
|
||||
zstd \
|
||||
maven=3.6.3-5 \
|
||||
openjdk-17-jdk
|
||||
openjdk-17-jdk \
|
||||
zstd
|
||||
|
||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||
|
||||
apt-get update
|
||||
apt-get install -y nfpm
|
||||
apt-get install -y nfpm=2.41.0
|
||||
|
||||
apt-get clean all
|
||||
|
||||
|
@ -8,9 +8,9 @@ apt-get update
|
||||
apt-get install -y \
|
||||
ca-certificates \
|
||||
git \
|
||||
openjdk-17-jdk \
|
||||
wget \
|
||||
zstd \
|
||||
openjdk-17-jdk
|
||||
zstd
|
||||
|
||||
cd /usr/local/src
|
||||
wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
|
||||
@ -21,7 +21,7 @@ rm -f apache-maven-3.8.8-bin.tar.gz
|
||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||
|
||||
apt-get update
|
||||
apt-get install -y nfpm
|
||||
apt-get install -y nfpm=2.41.0
|
||||
|
||||
apt-get clean all
|
||||
|
||||
|
30
.github/docker/packaging/Dockerfile.packaging-plugins-java-noble
vendored
Normal file
30
.github/docker/packaging/Dockerfile.packaging-plugins-java-noble
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
ARG REGISTRY_URL
|
||||
|
||||
FROM ${REGISTRY_URL}/ubuntu:noble
|
||||
|
||||
RUN bash -e <<EOF
|
||||
|
||||
apt-get update
|
||||
apt-get install -y \
|
||||
ca-certificates \
|
||||
git \
|
||||
openjdk-17-jdk \
|
||||
wget \
|
||||
zstd
|
||||
|
||||
cd /usr/local/src
|
||||
wget https://dlcdn.apache.org/maven/maven-3/3.8.8/binaries/apache-maven-3.8.8-bin.tar.gz
|
||||
tar zxf apache-maven-3.8.8-bin.tar.gz
|
||||
ln -s /usr/local/src/apache-maven-3.8.8/bin/mvn /usr/bin/mvn
|
||||
rm -f apache-maven-3.8.8-bin.tar.gz
|
||||
|
||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||
|
||||
apt-get update
|
||||
apt-get install -y nfpm=2.41.0
|
||||
|
||||
apt-get clean all
|
||||
|
||||
EOF
|
||||
|
||||
WORKDIR /src
|
72
.github/docker/packaging/Dockerfile.packaging-plugins-noble
vendored
Normal file
72
.github/docker/packaging/Dockerfile.packaging-plugins-noble
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/ubuntu:noble
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# fix locale
|
||||
RUN bash -e <<EOF
|
||||
|
||||
apt-get update
|
||||
apt-get install -y locales
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||
apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
ENV LANG=en_US.utf8
|
||||
|
||||
RUN bash -e <<EOF
|
||||
|
||||
apt-get update
|
||||
|
||||
echo 'http://deb.debian.org/debian' | apt-get install -y pbuilder
|
||||
|
||||
apt-get install -y \
|
||||
aptitude \
|
||||
ca-certificates \
|
||||
cpanminus \
|
||||
curl \
|
||||
debmake \
|
||||
devscripts \
|
||||
dh-make \
|
||||
dh-make-perl \
|
||||
fakeroot \
|
||||
gcc \
|
||||
git \
|
||||
git-buildpackage \
|
||||
jq \
|
||||
libapp-fatpacker-perl \
|
||||
libcurl4-openssl-dev \
|
||||
libczmq-dev \
|
||||
libczmq-dev\
|
||||
libfile-copy-recursive-perl \
|
||||
libjson-perl \
|
||||
libmodule-build-tiny-perl \
|
||||
libmodule-install-perl \
|
||||
libssh-dev \
|
||||
lintian \
|
||||
python3 \
|
||||
quilt \
|
||||
ruby \
|
||||
uuid-dev \
|
||||
zstd
|
||||
|
||||
cpanm Module::Build::Tiny
|
||||
cpanm Module::Install
|
||||
cpanm Crypt::OpenSSL::Guess
|
||||
|
||||
gem install fpm
|
||||
|
||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||
apt-get update
|
||||
apt-get install -y nfpm=2.41.0
|
||||
|
||||
apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
COPY .github/patch/fpm-deb.rb.diff /tmp/fpm-deb.rb.diff
|
||||
# Patch to apply fpm fix for debian package generation while waiting for the official fix to be released (https://github.com/jordansissel/fpm/pull/1947).
|
||||
RUN patch -i /tmp/fpm-deb.rb.diff $(find / -type f -name "deb.rb") && /bin/rm -rf /tmp/fpm-deb.rb.diff
|
@ -12,7 +12,7 @@ dnf clean all
|
||||
dnf install -y python3.11 python3.11-pip
|
||||
pip3.11 install robotframework robotframework-examples
|
||||
# Install snmpsim
|
||||
pip3.11 install snmpsim-lextudio
|
||||
pip3.11 install snmpsim
|
||||
|
||||
# Install node
|
||||
curl -fsSL https://rpm.nodesource.com/setup_21.x | bash -
|
||||
|
@ -12,7 +12,7 @@ dnf clean all
|
||||
dnf install -y python3.11 python3.11-pip
|
||||
pip3.11 install robotframework robotframework-examples
|
||||
# Install snmpsim
|
||||
pip3.11 install snmpsim-lextudio
|
||||
pip3.11 install snmpsim
|
||||
|
||||
# Install node
|
||||
curl -fsSL https://rpm.nodesource.com/setup_21.x | bash -
|
||||
|
@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/debian:bookworm
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# fix locale
|
||||
RUN bash -e <<EOF
|
||||
@ -15,16 +15,20 @@ apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
ENV LANG en_US.utf8
|
||||
ENV LANG=en_US.utf8
|
||||
|
||||
RUN bash -e <<EOF
|
||||
|
||||
# Avoid apt to clean packages cache directory
|
||||
rm -f /etc/apt/apt.conf.d/docker-clean
|
||||
|
||||
apt-get update
|
||||
# Install Robotframework
|
||||
apt-get install -y python3-dev python3-pip
|
||||
rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
|
||||
pip3 install robotframework robotframework-examples
|
||||
# Install snmpsim
|
||||
pip3 install snmpsim-lextudio
|
||||
pip3 install snmpsim
|
||||
|
||||
# Install nodejs
|
||||
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
||||
|
@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/debian:bullseye
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# fix locale
|
||||
RUN bash -e <<EOF
|
||||
@ -15,15 +15,19 @@ apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
ENV LANG en_US.utf8
|
||||
ENV LANG=en_US.utf8
|
||||
|
||||
RUN bash -e <<EOF
|
||||
|
||||
# Avoid apt to clean packages cache directory
|
||||
rm -f /etc/apt/apt.conf.d/docker-clean
|
||||
|
||||
apt-get update
|
||||
# Install Robotframework
|
||||
apt-get install -y python3 python3-dev python3-pip
|
||||
pip3 install robotframework robotframework-examples
|
||||
# Install snmpsim
|
||||
pip3 install snmpsim-lextudio
|
||||
pip3 install snmpsim
|
||||
|
||||
# Install nodejs
|
||||
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
||||
|
@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/ubuntu:jammy
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# fix locale
|
||||
RUN bash -e <<EOF
|
||||
@ -15,15 +15,19 @@ apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
ENV LANG en_US.utf8
|
||||
ENV LANG=en_US.utf8
|
||||
|
||||
RUN bash -e <<EOF
|
||||
|
||||
# Avoid apt to clean packages cache directory
|
||||
rm -f /etc/apt/apt.conf.d/docker-clean
|
||||
|
||||
apt-get update
|
||||
# Install Robotframework
|
||||
apt-get install -y python3 python3-dev python3-pip
|
||||
pip3 install robotframework robotframework-examples
|
||||
# Install snmpsim
|
||||
pip3 install snmpsim-lextudio
|
||||
pip3 install snmpsim
|
||||
|
||||
# Install nodejs
|
||||
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
||||
|
53
.github/docker/testing/Dockerfile.testing-plugins-noble
vendored
Normal file
53
.github/docker/testing/Dockerfile.testing-plugins-noble
vendored
Normal file
@ -0,0 +1,53 @@
|
||||
ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/ubuntu:noble
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# fix locale
|
||||
RUN bash -e <<EOF
|
||||
|
||||
apt-get update
|
||||
apt-get install -y locales libcurl4-openssl-dev curl wget zstd jq
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||
apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
ENV LANG=en_US.utf8
|
||||
|
||||
RUN bash -e <<EOF
|
||||
|
||||
# Avoid apt to clean packages cache directory
|
||||
rm -f /etc/apt/apt.conf.d/docker-clean
|
||||
|
||||
apt-get update
|
||||
# Install requirements for python virtual envs
|
||||
apt-get install -y python3-venv
|
||||
python3 -m venv .venv
|
||||
source .venv/bin/activate
|
||||
# Install Robotframework
|
||||
apt-get install -y python3 python3-dev python3-pip
|
||||
pip3 install robotframework robotframework-examples
|
||||
# Install snmpsim
|
||||
pip3 install snmpsim
|
||||
|
||||
# Install nodejs
|
||||
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
||||
apt-get install -y nodejs
|
||||
# Install mockoon (needs nodejs)
|
||||
npm install -g -D @mockoon/cli
|
||||
|
||||
# Add Centreon plugins repositories
|
||||
echo "deb https://packages.centreon.com/ubuntu-plugins-testing/ noble main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
|
||||
echo "deb https://packages.centreon.com/ubuntu-plugins-unstable/ noble main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
|
||||
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
|
||||
apt-get update
|
||||
|
||||
mkdir -p /var/lib/centreon/centplugins/
|
||||
chmod 777 /var/lib/centreon/centplugins/
|
||||
|
||||
apt-get clean
|
||||
|
||||
EOF
|
@ -47,6 +47,10 @@ gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n'\
|
||||
>> /etc/yum.repos.d/centreon-plugins.repo
|
||||
|
||||
dnf install -y gcc make cpan perl-Test2-Suite.noarch perl-Test2-Plugin-NoWarnings.noarch 'perl(Authen::Radius)' 'perl(Convert::Binary::C)' 'perl(Crypt::OpenSSL::RSA)' 'perl(Data::Dumper)' 'perl(Date::Parse)' 'perl(DateTime)' 'perl(DateTime::Duration)' 'perl(DateTime-Format-Duration-ISO8601)' 'perl(DateTime::Format::Strptime)' 'perl(DBD::mysql)' 'perl(DBD::ODBC)' 'perl(DBD::Pg)' 'perl(DBD::Sybase)' 'perl(DBI)' 'perl(Device::Modbus::RTU::Client)' 'perl(Device::Modbus::TCP::Client)' 'perl(Digest::CRC)' 'perl(Digest::MD5)' 'perl(Digest::SHA)' 'perl(Email::MIME)' 'perl(Email::Sender)' 'perl(Email::Send::SMTP::Gmail)' 'perl(Email::Simple)' 'perl(File::Basename)' 'perl(Filesys::SmbClient)' 'perl(Hash::Ordered)' 'perl(HTML::Template)' 'perl(IO::Select)' 'perl(IO::Socket)' 'perl(IO::Socket::INET)' 'perl(IO::Socket::INET6)' 'perl(IO::Socket::SSL)' 'perl(JMX::Jmx4Perl)' 'perl(JSON)' 'perl(JSON::Path)' 'perl(JSON::WebToken)' 'perl(JSON::XS)' 'perl(Libssh::Session)' 'perl-Mail-IMAPClient' 'perl(MIME::Base64)' 'perl(MongoDB)' 'perl(NetAddr::IP)' 'perl(Net::DHCP::Constants)' 'perl(Net::DHCP::Packet)' 'perl(Net::DNS)' 'perl(Net::FTP)' 'perl(Net::FTPSSL)' 'perl(Net::LDAP)' 'perl(Net::MQTT::Simple)' 'perl(Net::NTP)' 'perl(Net::SSLeay)' 'perl(Net::Subnet)' 'perl(Net::Telnet)' 'perl(Net::TFTP)' 'perl(openwsman)' 'perl(Pod::Parser)' 'perl(POSIX)' 'perl(Redis)' 'perl(RRDs)' 'perl(SNMP)' 'perl(Socket)' 'perl(Text::CSV)' 'perl(Time::HiRes)' 'perl(URI::Encode)' 'perl(URI::Escape)' 'perl(UUID)' 'perl(WWW::Selenium)' 'perl(XML::LibXML)' 'perl(XML::LibXML::Simple)' 'perl(XML::Simple)' 'perl(XML::XPath)' 'perl(ZMQ::LibZMQ4)' 'perl(Data::UUID)'
|
||||
# this image is used by centreon-perl-libs unit test and centreon-gorgone unit tests.
|
||||
dnf -y install 'perl(Crypt::OpenSSL::AES)' 'perl-Net-Curl' 'perl(YAML::XS)' 'perl(Hash::Merge)' 'perl(Clone)' 'perl(CryptX)' 'perl(JSON::XS)' 'perl(JSON::PP)'
|
||||
dnf -y install 'perl(Hash::Merge)' 'perl(YAML::XS)' 'perl(ZMQ::FFI)' 'perl-CryptX' 'perl(EV)'
|
||||
|
||||
dnf clean all
|
||||
mkdir -p /var/lib/centreon/centplugins/
|
||||
chmod 777 /var/lib/centreon/centplugins/
|
||||
|
@ -46,6 +46,9 @@ gpgcheck=1\n\
|
||||
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n'\
|
||||
>> /etc/yum.repos.d/centreon-plugins.repo
|
||||
dnf install -y make cpan perl-Test2-Suite.noarch 'perl(Authen::Radius)' 'perl(Convert::Binary::C)' 'perl(Crypt::OpenSSL::RSA)' 'perl(Data::Dumper)' 'perl(Date::Parse)' 'perl(DateTime)' 'perl(DateTime::Duration)' 'perl(DateTime-Format-Duration-ISO8601)' 'perl(DateTime::Format::Strptime)' 'perl(DBD::mysql)' 'perl(DBD::ODBC)' 'perl(DBD::Pg)' 'perl(DBD::Sybase)' 'perl(DBI)' 'perl(Device::Modbus::RTU::Client)' 'perl(Device::Modbus::TCP::Client)' 'perl(Digest::CRC)' 'perl(Digest::MD5)' 'perl(Digest::SHA)' 'perl(Email::MIME)' 'perl(Email::Sender)' 'perl(Email::Send::SMTP::Gmail)' 'perl(Email::Simple)' 'perl(File::Basename)' 'perl(Filesys::SmbClient)' 'perl(Hash::Ordered)' 'perl(HTML::Template)' 'perl(IO::Select)' 'perl(IO::Socket)' 'perl(IO::Socket::INET)' 'perl(IO::Socket::INET6)' 'perl(IO::Socket::SSL)' 'perl(JMX::Jmx4Perl)' 'perl(JSON)' 'perl(JSON::Path)' 'perl(JSON::WebToken)' 'perl(JSON::XS)' 'perl(Libssh::Session)' 'perl-Mail-IMAPClient' 'perl(MIME::Base64)' 'perl(MongoDB)' 'perl(NetAddr::IP)' 'perl(Net::DHCP::Constants)' 'perl(Net::DHCP::Packet)' 'perl(Net::DNS)' 'perl(Net::FTP)' 'perl(Net::FTPSSL)' 'perl(Net::LDAP)' 'perl(Net::MQTT::Simple)' 'perl(Net::NTP)' 'perl(Net::SSLeay)' 'perl(Net::Subnet)' 'perl(Net::Telnet)' 'perl(Net::TFTP)' 'perl(openwsman)' 'perl(Pod::Parser)' 'perl(POSIX)' 'perl(Redis)' 'perl(RRDs)' 'perl(SNMP)' 'perl(Socket)' 'perl(Text::CSV)' 'perl(Time::HiRes)' 'perl(URI::Encode)' 'perl(URI::Escape)' 'perl(UUID)' 'perl(WWW::Selenium)' 'perl(XML::LibXML)' 'perl(XML::LibXML::Simple)' 'perl(XML::Simple)' 'perl(XML::XPath)' 'perl(ZMQ::LibZMQ4)' 'perl(Data::UUID)'
|
||||
# this image is used by centreon-perl-libs unit test and centreon-gorgone unit tests.
|
||||
dnf -y install 'perl(Crypt::OpenSSL::AES)' 'perl-Net-Curl' 'perl(YAML::XS)' 'perl(Hash::Merge)' 'perl(Clone)' 'perl(CryptX)' 'perl(JSON::XS)' 'perl(JSON::PP)'
|
||||
dnf -y install 'perl(Hash::Merge)' 'perl(YAML::XS)' 'perl(ZMQ::FFI)' 'perl-CryptX' 'perl(EV)'
|
||||
dnf clean all
|
||||
mkdir -p /var/lib/centreon/centplugins/
|
||||
chmod 777 /var/lib/centreon/centplugins/
|
||||
|
@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/debian:bookworm
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# fix locale
|
||||
RUN bash -e <<EOF
|
||||
@ -14,7 +14,7 @@ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||
apt-get clean
|
||||
EOF
|
||||
|
||||
ENV LANG en_US.utf8
|
||||
ENV LANG=en_US.utf8
|
||||
|
||||
RUN bash -e <<EOF
|
||||
# Add Centreon plugins repositories
|
||||
@ -24,6 +24,9 @@ echo "deb https://packages.centreon.com/apt-plugins-unstable/ bookworm main" | t
|
||||
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
|
||||
apt-get update
|
||||
apt-get -y install libtest2-harness-perl libtest2-plugin-nowarnings-perl libauthen-radius-perl libconvert-binary-c-perl libcrypt-openssl-rsa-perl libdata-dump-perl libdatetime-format-dateparse-perl libdatetime-format-strptime-perl libdatetime-perl libdbd-mysql-perl libdbd-odbc-perl libdbd-pg-perl libdbd-sybase-perl libdbi-perl libdigest-crc-perl libdigest-md5-perl libdigest-sha-perl libemail-mime-perl libemail-sender-perl libemail-send-smtp-gmail-perl libfilesys-smbclient-perl libhtml-template-perl libio-socket-inet6-perl libio-socket-ip-perl libjson-maybexs-perl libjson-perl libjson-webtoken-perl libmail-imapclient-perl libmime-base64-perl libmongodb-perl libnet-dhcp-perl libnet-dns-perl libnet-ldap-perl libnet-mqtt-simple-perl libnet-ntp-perl libnet-ssleay-perl libnet-subnet-perl libnet-telnet-perl libnet-tftp-perl libopenwsman-perl libredis-perl librrds-perl libsnmp-perl libsocket-perl libssh-session-perl libtest-www-selenium-perl libtext-csv-perl libtime-hires-perl libtime-parsedate-perl libuuid-perl libxml-libxml-perl libxml-libxml-simple-perl libxml-simple-perl libxml-xpath-perl perl perl-modules
|
||||
# this image is used by centreon-perl-libs unit test and centreon-gorgone unit tests.
|
||||
apt-get -y install libcrypt-openssl-aes-perl libnet-curl-perl libyaml-libyaml-perl libhash-merge-perl libclone-choose-perl libcryptx-perl libjson-xs-perl libjson-pp-perl
|
||||
apt-get -y install libhash-merge-perl libyaml-libyaml-perl libzmq-ffi-perl libcryptx-perl libev-perl
|
||||
apt-get clean
|
||||
EOF
|
||||
|
||||
|
@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/debian:bullseye
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# fix locale
|
||||
RUN bash -e <<EOF
|
||||
@ -14,7 +14,7 @@ localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||
apt-get clean
|
||||
EOF
|
||||
|
||||
ENV LANG en_US.utf8
|
||||
ENV LANG=en_US.utf8
|
||||
|
||||
RUN bash -e <<EOF
|
||||
# Add Centreon plugins repositories
|
||||
@ -24,6 +24,9 @@ echo "deb https://packages.centreon.com/apt-plugins-unstable/ bullseye main" | t
|
||||
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
|
||||
apt-get update
|
||||
apt-get -y install gcc make libtest2-plugin-nowarnings-perl libauthen-radius-perl libconvert-binary-c-perl libcrypt-openssl-rsa-perl libdata-dump-perl libdatetime-format-dateparse-perl libdatetime-format-strptime-perl libdatetime-perl libdbd-mysql-perl libdbd-odbc-perl libdbd-pg-perl libdbd-sybase-perl libdbi-perl libdigest-crc-perl libdigest-md5-perl libdigest-sha-perl libemail-mime-perl libemail-sender-perl libemail-send-smtp-gmail-perl libfilesys-smbclient-perl libhtml-template-perl libio-socket-inet6-perl libio-socket-ip-perl libjson-maybexs-perl libjson-perl libjson-webtoken-perl libmail-imapclient-perl libmime-base64-perl libmongodb-perl libnet-dhcp-perl libnet-dns-perl libnet-ldap-perl libnet-mqtt-simple-perl libnet-ntp-perl libnet-ssleay-perl libnet-subnet-perl libnet-telnet-perl libnet-tftp-perl libopenwsman-perl libredis-perl librrds-perl libsnmp-perl libsocket-perl libssh-session-perl libtest-www-selenium-perl libtext-csv-perl libtime-hires-perl libtime-parsedate-perl libuuid-perl libxml-libxml-perl libxml-libxml-simple-perl libxml-simple-perl libxml-xpath-perl perl perl-modules libdata-uuid-perl
|
||||
# this image is used by centreon-perl-libs unit test and centreon-gorgone unit tests.
|
||||
apt-get -y install libcrypt-openssl-aes-perl libnet-curl-perl libyaml-libyaml-perl libhash-merge-perl libclone-choose-perl libcryptx-perl libjson-xs-perl libjson-pp-perl
|
||||
apt-get -y install libhash-merge-perl libyaml-libyaml-perl libzmq-ffi-perl libcryptx-perl libev-perl libcpanel-json-xs-perl
|
||||
apt-get clean
|
||||
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness UUID
|
||||
EOF
|
||||
|
@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/ubuntu:jammy
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# fix locale
|
||||
RUN bash -e <<EOF
|
||||
@ -15,7 +15,7 @@ apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
ENV LANG en_US.utf8
|
||||
ENV LANG=en_US.utf8
|
||||
|
||||
RUN bash -e <<EOF
|
||||
# Add Centreon plugins repositories
|
||||
@ -25,8 +25,11 @@ echo "deb https://packages.centreon.com/ubuntu-plugins-unstable/ jammy main" | t
|
||||
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
|
||||
|
||||
apt-get update
|
||||
apt-get -y install libtest2-harness-perl libtest2-plugin-nowarnings-perl libauthen-radius-perl libconvert-binary-c-perl libcrypt-openssl-rsa-perl libdata-dump-perl libdatetime-format-dateparse-perl libdatetime-format-strptime-perl libdatetime-perl libdbd-mysql-perl libdbd-odbc-perl libdbd-pg-perl libdbd-sybase-perl libdbi-perl libdigest-crc-perl libdigest-md5-perl libdigest-sha-perl libemail-mime-perl libemail-sender-perl libemail-send-smtp-gmail-perl libfilesys-smbclient-perl libhtml-template-perl libio-socket-inet6-perl libio-socket-ip-perl libjmx4perl-perl libjson-maybexs-perl libjson-perl libjson-webtoken-perl libmail-imapclient-perl libmime-base64-perl libmongodb-perl libnet-dhcp-perl libnet-dns-perl libnet-ldap-perl libnet-mqtt-simple-perl libnet-ntp-perl libnet-ssleay-perl libnet-subnet-perl libnet-telnet-perl libnet-tftp-perl libopenwsman-perl libredis-perl librrds-perl libsnmp-perl libsocket-perl libssh-session-perl libtest-www-selenium-perl libtext-csv-perl libtime-hires-perl libtime-parsedate-perl libuuid-perl libxml-libxml-perl libxml-libxml-simple-perl libxml-simple-perl libxml-xpath-perl libzmq-libzmq4-perl perl perl-modules
|
||||
apt-get -y install gcc make libtest2-plugin-nowarnings-perl libauthen-radius-perl libconvert-binary-c-perl libcrypt-openssl-rsa-perl libdata-dump-perl libdatetime-format-dateparse-perl libdatetime-format-strptime-perl libdatetime-perl libdbd-mysql-perl libdbd-odbc-perl libdbd-pg-perl libdbd-sybase-perl libdbi-perl libdigest-crc-perl libdigest-md5-perl libdigest-sha-perl libemail-mime-perl libemail-sender-perl libemail-send-smtp-gmail-perl libfilesys-smbclient-perl libhtml-template-perl libio-socket-inet6-perl libio-socket-ip-perl libjmx4perl-perl libjson-maybexs-perl libjson-perl libjson-webtoken-perl libmail-imapclient-perl libmime-base64-perl libmongodb-perl libnet-dhcp-perl libnet-dns-perl libnet-ldap-perl libnet-mqtt-simple-perl libnet-ntp-perl libnet-ssleay-perl libnet-subnet-perl libnet-telnet-perl libnet-tftp-perl libopenwsman-perl libredis-perl librrds-perl libsnmp-perl libsocket-perl libssh-session-perl libtest-www-selenium-perl libtext-csv-perl libtime-hires-perl libtime-parsedate-perl libuuid-perl libxml-libxml-perl libxml-libxml-simple-perl libxml-simple-perl libxml-xpath-perl libzmq-libzmq4-perl perl perl-modules
|
||||
# this image is used by centreon-perl-libs unit test and centreon-gorgone unit tests.
|
||||
apt-get -y install libcrypt-openssl-aes-perl libnet-curl-perl libyaml-libyaml-perl libhash-merge-perl libclone-choose-perl libcryptx-perl libjson-xs-perl libjson-pp-perl
|
||||
apt-get clean
|
||||
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness UUID
|
||||
|
||||
mkdir -p /var/lib/centreon/centplugins/
|
||||
chmod 777 /var/lib/centreon/centplugins/
|
||||
|
37
.github/docker/unit-tests/Dockerfile.unit-tests-noble
vendored
Normal file
37
.github/docker/unit-tests/Dockerfile.unit-tests-noble
vendored
Normal file
@ -0,0 +1,37 @@
|
||||
ARG REGISTRY_URL=docker.io
|
||||
|
||||
FROM ${REGISTRY_URL}/ubuntu:noble
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive
|
||||
|
||||
# fix locale
|
||||
RUN bash -e <<EOF
|
||||
|
||||
apt-get update
|
||||
apt-get install -y locales libcurl4-openssl-dev curl wget zstd jq gpg
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||
apt-get clean
|
||||
|
||||
EOF
|
||||
|
||||
ENV LANG=en_US.utf8
|
||||
|
||||
RUN bash -e <<EOF
|
||||
# Add Centreon plugins repositories
|
||||
echo "deb https://packages.centreon.com/ubuntu-plugins-stable/ noble main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
|
||||
echo "deb https://packages.centreon.com/ubuntu-plugins-testing/ noble main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
|
||||
echo "deb https://packages.centreon.com/ubuntu-plugins-unstable/ noble main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
|
||||
wget -O- https://apt-key.centreon.com | gpg --dearmor | tee /etc/apt/trusted.gpg.d/centreon.gpg > /dev/null 2>&1
|
||||
|
||||
apt-get update
|
||||
apt-get -y install gcc make libtest2-plugin-nowarnings-perl libauthen-radius-perl libconvert-binary-c-perl libcrypt-openssl-rsa-perl libdata-dump-perl libdatetime-format-dateparse-perl libdatetime-format-strptime-perl libdatetime-perl libdbd-mysql-perl libdbd-odbc-perl libdbd-pg-perl libdbd-sybase-perl libdbi-perl libdigest-crc-perl libdigest-md5-perl libdigest-sha-perl libemail-mime-perl libemail-sender-perl libemail-send-smtp-gmail-perl libfilesys-smbclient-perl libhtml-template-perl libio-socket-inet6-perl libio-socket-ip-perl libjmx4perl-perl libjson-maybexs-perl libjson-perl libjson-webtoken-perl libmail-imapclient-perl libmime-base64-perl libmongodb-perl libnet-dhcp-perl libnet-dns-perl libnet-ldap-perl libnet-mqtt-simple-perl libnet-ntp-perl libnet-ssleay-perl libnet-subnet-perl libnet-telnet-perl libnet-tftp-perl libopenwsman-perl libredis-perl librrds-perl libsnmp-perl libsocket-perl libssh-session-perl libtest-www-selenium-perl libtext-csv-perl libtime-hires-perl libtime-parsedate-perl libuuid-perl libxml-libxml-perl libxml-libxml-simple-perl libxml-simple-perl libxml-xpath-perl libzmq-libzmq4-perl perl perl-modules
|
||||
# this image is used by centreon-perl-libs unit test and centreon-gorgone unit tests.
|
||||
apt-get -y install libcrypt-openssl-aes-perl libnet-curl-perl libyaml-libyaml-perl libhash-merge-perl libclone-choose-perl libcryptx-perl libjson-xs-perl libjson-pp-perl
|
||||
apt-get clean
|
||||
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness UUID
|
||||
|
||||
mkdir -p /var/lib/centreon/centplugins/
|
||||
chmod 777 /var/lib/centreon/centplugins/
|
||||
|
||||
EOF
|
@ -30,6 +30,7 @@ provides:
|
||||
overrides:
|
||||
rpm:
|
||||
depends: [
|
||||
perl(Crypt::OpenSSL::AES),
|
||||
perl(Digest::MD5),
|
||||
perl(Pod::Find),
|
||||
perl-Net-Curl,
|
||||
@ -62,6 +63,7 @@ overrides:
|
||||
[@RPM_PROVIDES@]
|
||||
deb:
|
||||
depends: [
|
||||
libcrypt-openssl-aes-perl,
|
||||
libpod-parser-perl,
|
||||
libnet-curl-perl,
|
||||
liburi-encode-perl,
|
||||
|
57
.github/scripts/pod_spell_check.t
vendored
57
.github/scripts/pod_spell_check.t
vendored
@ -1,23 +1,62 @@
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More;
|
||||
use Test::Spelling;
|
||||
use List::MoreUtils qw(uniq);
|
||||
|
||||
# the command must have at least one argument
|
||||
if (!@ARGV) {
|
||||
die "Usage: perl pod_spell_check.t module.pm stopwords.t";
|
||||
}
|
||||
# the first argument is the module to check
|
||||
my $module_to_check = $ARGV[0];
|
||||
|
||||
# the second (optional) argument is the additional dictionary
|
||||
my $stopword_filename='tests/resources/spellcheck/stopwords.txt';
|
||||
if(defined($ARGV[1])){
|
||||
$stopword_filename=$ARGV[1];
|
||||
}
|
||||
open(FILE, "<", $stopword_filename)
|
||||
or die "Could not open $stopword_filename";
|
||||
printf("Using dictionary: ".$stopword_filename." \n");
|
||||
|
||||
add_stopwords(<FILE>);
|
||||
close(FILE);
|
||||
set_spell_cmd('hunspell -l');
|
||||
all_pod_files_spelling_ok($ARGV[0]);
|
||||
# get_stopwords(): reads the text file and returns its content as an array or strings
|
||||
sub get_stopwords {
|
||||
my ($file) = @_;
|
||||
|
||||
open(FILE, "<", $stopword_filename)
|
||||
or die "Could not open $stopword_filename";
|
||||
printf("Using dictionary: ".$stopword_filename." \n");
|
||||
my @stop_words;
|
||||
for my $line (<FILE>) {
|
||||
chomp $line;
|
||||
push @stop_words, $line;
|
||||
}
|
||||
close(FILE);
|
||||
|
||||
return @stop_words;
|
||||
}
|
||||
|
||||
# get_module_options(): reads the Perl module file's POD and returns all the encountered --options
|
||||
sub get_module_options {
|
||||
my ($module) = @_;
|
||||
|
||||
my @cmd_result = `perldoc -T $module_to_check`;
|
||||
my @new_words;
|
||||
|
||||
for my $pod_line (@cmd_result) {
|
||||
chomp $pod_line;
|
||||
my @parsed_options = $pod_line =~ /(--[\w-]+){1,}\s?/mg or next;
|
||||
push @new_words, @parsed_options;
|
||||
}
|
||||
|
||||
return uniq(sort(@new_words));
|
||||
}
|
||||
|
||||
my @known_words = get_stopwords($stopword_filename);
|
||||
my @module_options = get_module_options($module_to_check);
|
||||
|
||||
# take all words from the text file and the module's options as valid words
|
||||
add_stopwords(@known_words, @module_options);
|
||||
|
||||
# prepare the spelling check command
|
||||
set_spell_cmd('hunspell -d en_US -l');
|
||||
|
||||
# check that all is correct in the Perl module file given as an argument
|
||||
all_pod_files_spelling_ok($module_to_check);
|
||||
|
20
.github/scripts/process-plugins.py
vendored
20
.github/scripts/process-plugins.py
vendored
@ -40,21 +40,29 @@ for filepath in os.popen('find packaging -type f -name pkg.json').read().split('
|
||||
packaging_file = open(filepath)
|
||||
packaging = json.load(packaging_file)
|
||||
packaging_file.close()
|
||||
packaging_path = re.search('.*\/(centreon-plugin-.*)\/pkg.json', filepath).group(1)
|
||||
|
||||
if not packaging_path == packaging["pkg_name"]:
|
||||
packaging_path = packaging["pkg_name"]
|
||||
packaging_path = packaging["pkg_name"]
|
||||
|
||||
directory_path = re.search('^(.+)\/pkg.json', filepath).group(1)
|
||||
|
||||
if common:
|
||||
# if the common flag is true, then all packages are included
|
||||
list_packages.add(packaging_path)
|
||||
elif directory_path in packages:
|
||||
# if a package file is changed or created, then the package is included
|
||||
list_packages.add(packaging_path)
|
||||
else:
|
||||
# if we don't build all the plugins and no modification have been made to this package's
|
||||
# specification, then examine if its source code has been changed
|
||||
for pkg_file in packaging["files"]:
|
||||
# for each source code file or directory included in the current package
|
||||
pkg_file_dir = pkg_file.strip('/').removeprefix('src/')
|
||||
if pkg_file_dir in list_plugins:
|
||||
list_packages.add(packaging_path)
|
||||
# the current package is impacted by the changes if one of the changed files
|
||||
# is located inside one of the directories of the package
|
||||
for modified_file in list_plugins:
|
||||
# if the beginning of the changed file path includes one of the package's directories
|
||||
if modified_file.find(pkg_file_dir) == 0:
|
||||
# then the package is included
|
||||
list_packages.add(packaging_path)
|
||||
break
|
||||
|
||||
print(*list_packages)
|
||||
|
10
.github/scripts/test-all-plugins.py
vendored
10
.github/scripts/test-all-plugins.py
vendored
@ -11,7 +11,7 @@ def get_tests_folders(plugin_name):
|
||||
pkg_file = open("./packaging/" + plugin_name + "/pkg.json")
|
||||
packaging = json.load(pkg_file)
|
||||
for file in packaging["files"]: # loop on "files" array in pkg.json file.
|
||||
if file.endswith("/") and os.path.exists("tests/" + file): # if this is a directory and there is test for it.
|
||||
if os.path.isdir("tests/" + file): # check if the path is a directory in the "tests" folder
|
||||
folder_list.append("tests/" + file)
|
||||
return folder_list
|
||||
|
||||
@ -74,8 +74,8 @@ def install_plugin(plugin, archi):
|
||||
"apt-get install -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' -y ./" + plugin.lower() + "*.deb",
|
||||
shell=True, check=False, stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
||||
elif archi == "rpm":
|
||||
outfile.write("dnf install -y ./" + plugin + "*.rpm\n")
|
||||
output_status = (subprocess.run("dnf install -y ./" + plugin + "*.rpm", shell=True, check=False,
|
||||
outfile.write("dnf install --setopt=keepcache=True -y ./" + plugin + "*.rpm\n")
|
||||
output_status = (subprocess.run("dnf install --setopt=keepcache=True -y ./" + plugin + "*.rpm", shell=True, check=False,
|
||||
stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
||||
else:
|
||||
print(f"Unknown architecture, expected deb or rpm, got {archi}. Exiting.")
|
||||
@ -95,8 +95,8 @@ def remove_plugin(plugin, archi):
|
||||
# 'autoremove', contrary to 'remove' all dependancy while removing the original package.
|
||||
|
||||
elif archi == "rpm":
|
||||
outfile.write("dnf remove -y " + plugin + "\n")
|
||||
output_status = (subprocess.run("dnf remove -y " + plugin, shell=True, check=False,
|
||||
outfile.write("dnf remove --setopt=keepcache=True -y " + plugin + "\n")
|
||||
output_status = (subprocess.run("dnf remove --setopt=keepcache=True -y " + plugin, shell=True, check=False,
|
||||
stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
||||
else:
|
||||
print(f"Unknown architecture, expected deb or rpm, got {archi}. Exiting.")
|
||||
|
11
.github/workflows/actionlint.yml
vendored
11
.github/workflows/actionlint.yml
vendored
@ -15,8 +15,8 @@ on:
|
||||
- ".github/**"
|
||||
|
||||
jobs:
|
||||
actionlint:
|
||||
runs-on: ubuntu-22.04
|
||||
action-lint:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
@ -29,15 +29,16 @@ jobs:
|
||||
- name: Check workflow files
|
||||
run: |
|
||||
${{ steps.get_actionlint.outputs.executable }} \
|
||||
-ignore 'label "common" is unknown' \
|
||||
-ignore 'label "veracode" is unknown' \
|
||||
-ignore 'label "centreon-common" is unknown' \
|
||||
-ignore 'label "centreon-collect-arm64" is unknown' \
|
||||
-ignore '"github.head_ref" is potentially untrusted' \
|
||||
-shellcheck= \
|
||||
-pyflakes= \
|
||||
-color
|
||||
shell: bash
|
||||
|
||||
yaml-lint:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
83
.github/workflows/as400.yml
vendored
83
.github/workflows/as400.yml
vendored
@ -20,10 +20,13 @@ jobs:
|
||||
get-environment:
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
with:
|
||||
version_file: as400/packaging/centreon-as400-daemon.yaml
|
||||
version_file: as400/connector.as400/pom.xml
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@ -44,13 +47,15 @@ jobs:
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-java-jammy
|
||||
distrib: jammy
|
||||
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-java-noble
|
||||
distrib: noble
|
||||
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
name: package ${{ matrix.distrib }}
|
||||
|
||||
@ -64,8 +69,8 @@ jobs:
|
||||
-type f \
|
||||
-exec grep -E '(@CONNECTOR_VERSION@)|(@CONNECTOR_HOME@)|(@CONNECTOR_ETC@)|(@CONNECTOR_LOG@)|(@CONNECTOR_USER@)|(@JAVA_BIN@)' {} ';' \
|
||||
-exec sed -i \
|
||||
-e 's|@CONNECTOR_VERSION@|'"%{version}"'|g' \
|
||||
-e 's|@CONNECTOR_HOME@|'"%{_datadir}/centreon-as400"'|g' \
|
||||
-e 's|@CONNECTOR_VERSION@|'"${{ needs.get-environment.outputs.version }}"'|g' \
|
||||
-e 's|@CONNECTOR_HOME@|'"/usr/share/centreon-as400"'|g' \
|
||||
-e 's|@CONNECTOR_ETC@|'"/etc/centreon-as400/"'|g' \
|
||||
-e 's|@CONNECTOR_LOG@|'"/var/log/centreon-as400/"'|g' \
|
||||
-e 's|@CONNECTOR_USER@|'"centreon-as400"'|g' \
|
||||
@ -99,51 +104,57 @@ jobs:
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
- name: Save to cache
|
||||
uses: actions/cache/save@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3.3.2
|
||||
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.${{ matrix.package_extension }}
|
||||
key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||
|
||||
deliver-rpm:
|
||||
deliver-packages:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
- distrib: bullseye
|
||||
package_extension: deb
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
- distrib: jammy
|
||||
package_extension: deb
|
||||
- distrib: noble
|
||||
package_extension: deb
|
||||
|
||||
name: deliver ${{ matrix.distrib }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
module_name: as400
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: as400
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
180
.github/workflows/check-status.yml
vendored
Normal file
180
.github/workflows/check-status.yml
vendored
Normal file
@ -0,0 +1,180 @@
|
||||
name: check-status
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- develop
|
||||
- master
|
||||
- hotfix-*
|
||||
- release-*
|
||||
|
||||
jobs:
|
||||
check-status:
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Check workflow statuses and display token usage
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
echo "current rest api rate usage:"
|
||||
curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit | jq .rate
|
||||
echo ""
|
||||
echo ""
|
||||
echo "current graphql rate usage:"
|
||||
curl -s -H "Accept: application/vnd.github+json" -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" https://api.github.com/rate_limit | jq .resources.graphql
|
||||
echo ""
|
||||
echo ""
|
||||
|
||||
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
PR_NUMBER: ${{ github.event.number }}
|
||||
with:
|
||||
script: |
|
||||
await exec.exec("sleep 20s");
|
||||
|
||||
for (let i = 0; i < 120; i++) {
|
||||
const failure = [];
|
||||
const cancelled = [];
|
||||
const pending = [];
|
||||
|
||||
const result = await github.rest.checks.listSuitesForRef({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
ref: "${{ github.head_ref }}"
|
||||
});
|
||||
result.data.check_suites.forEach(({ app: { slug }, conclusion, id}) => {
|
||||
if (slug === 'github-actions') {
|
||||
if (conclusion === 'failure' || conclusion === 'cancelled') {
|
||||
failure.push(id);
|
||||
} else if (conclusion === null) {
|
||||
pending.push(id);
|
||||
}
|
||||
console.log(`check suite ${id} => ${conclusion === null ? 'pending' : conclusion}`);
|
||||
}
|
||||
});
|
||||
|
||||
if (pending.length === 0) {
|
||||
core.setFailed("Cannot get pull request check status");
|
||||
return;
|
||||
}
|
||||
|
||||
if (failure.length > 0) {
|
||||
let failureMessage = '';
|
||||
const failedCheckRuns = [];
|
||||
for await (const suite_id of failure) {
|
||||
const resultCheckRuns = await github.rest.checks.listForSuite({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
check_suite_id: suite_id
|
||||
});
|
||||
|
||||
resultCheckRuns.data.check_runs.forEach(({ conclusion, name, html_url }) => {
|
||||
if (conclusion === 'failure' || conclusion === 'cancelled') {
|
||||
failedCheckRuns.push(`<a href="${html_url}">${name} (${conclusion})</a>`);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
core.summary.addRaw(`${failedCheckRuns.length} job(s) failed:`, true)
|
||||
core.summary.addList(failedCheckRuns);
|
||||
core.summary.write()
|
||||
|
||||
if (failedCheckRuns.length > 0) {
|
||||
core.setFailed(`${failedCheckRuns.length} job(s) failed`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (pending.length === 1) {
|
||||
core.info("All workflows are ok");
|
||||
return;
|
||||
}
|
||||
|
||||
core.info(`${pending.length} workflows in progress`);
|
||||
|
||||
await exec.exec("sleep 30s");
|
||||
}
|
||||
|
||||
core.setFailed("Timeout: some jobs are still in progress");
|
||||
|
||||
get-environment:
|
||||
if: |
|
||||
contains(fromJSON('["pull_request", "pull_request_target"]') , github.event_name) &&
|
||||
(startsWith(github.base_ref, 'release-') || startsWith(github.base_ref, 'hotfix-'))
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
|
||||
check-cherry-pick:
|
||||
needs: [get-environment, check-status]
|
||||
runs-on: ubuntu-24.04
|
||||
if: |
|
||||
contains(fromJSON('["pull_request", "pull_request_target"]') , github.event_name) &&
|
||||
needs.get-environment.outputs.target_stability == 'testing' &&
|
||||
! contains(needs.get-environment.outputs.labels, 'skip-cherry-pick')
|
||||
|
||||
steps:
|
||||
- name: Check if the PR is a cherry-pick from dev branch
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
env:
|
||||
LINKED_DEV_BRANCH: develop
|
||||
with:
|
||||
script: |
|
||||
let linkedPrs = [];
|
||||
let errorMessage = `This pull request is not a cherry-pick from ${process.env.LINKED_DEV_BRANCH} or has no reference to a pull request which has been merged on ${process.env.LINKED_DEV_BRANCH}\n`;
|
||||
|
||||
try {
|
||||
const pull = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: context.issue.number
|
||||
});
|
||||
|
||||
const { title, body } = pull.data;
|
||||
|
||||
[title, body].forEach((text) => {
|
||||
const linkedPrMatches = text.matchAll(/(?:#|\/pull\/)(\d+)/g);
|
||||
if (linkedPrMatches) {
|
||||
[...linkedPrMatches].forEach((match) => {
|
||||
linkedPrs.push(Number(match[1]));
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// remove duplicates
|
||||
linkedPrs = [...new Set(linkedPrs)];
|
||||
console.log(`Linked pull requests found in PR title and body: ${linkedPrs.join(', ')}`);
|
||||
} catch (e) {
|
||||
throw new Error(`Failed to get information of pull request #${context.issue.number}: ${e}`);
|
||||
}
|
||||
|
||||
for await (const prNumber of linkedPrs) {
|
||||
try {
|
||||
const pull = await github.rest.pulls.get({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
pull_number: prNumber
|
||||
});
|
||||
|
||||
if (pull.data.base.ref === process.env.LINKED_DEV_BRANCH) {
|
||||
if (pull.data.state === 'closed' && pull.data.merged === true) {
|
||||
console.log(`This pull request is a cherry-pick from pull request #${prNumber} on ${process.env.LINKED_DEV_BRANCH}`);
|
||||
return;
|
||||
} else {
|
||||
errorMessage += `This pull request seems to be a cherry-pick from pull request #${prNumber} on ${process.env.LINKED_DEV_BRANCH} but it is not merged yet\n`;
|
||||
}
|
||||
} else {
|
||||
errorMessage += `Pull request #${prNumber} is linked to ${pull.data.base.ref} instead of ${process.env.LINKED_DEV_BRANCH}\n`;
|
||||
}
|
||||
} catch (e) {
|
||||
errorMessage += `Failed to get information on pull request #${prNumber}: ${e}\n`;
|
||||
}
|
||||
}
|
||||
|
||||
errorMessage += `\nIf you are sure this PR does not need to be a cherry-pick from ${process.env.LINKED_DEV_BRANCH} or must be merged urgently, `;
|
||||
errorMessage += `open the pull request on ${process.env.LINKED_DEV_BRANCH} and add label "skip-cherry-pick" to the PR and re-run all jobs of workflow check-status\n`;
|
||||
|
||||
throw new Error(errorMessage);
|
97
.github/workflows/connector-vmware.yml
vendored
97
.github/workflows/connector-vmware.yml
vendored
@ -26,7 +26,9 @@ jobs:
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
@ -46,12 +48,15 @@ jobs:
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-jammy
|
||||
distrib: jammy
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-noble
|
||||
distrib: noble
|
||||
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
name: package ${{ matrix.distrib }}
|
||||
|
||||
@ -75,72 +80,58 @@ jobs:
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
- name: Upload apt/dnf packages as artifacts if asked
|
||||
if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
|
||||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: vmware-connector-daemon-${{ matrix.distrib }}
|
||||
path: centreon-plugin*
|
||||
retention-days: 1
|
||||
|
||||
deliver-rpm:
|
||||
deliver-packages:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
- distrib: bullseye
|
||||
package_extension: deb
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
- distrib: jammy
|
||||
package_extension: deb
|
||||
- distrib: noble
|
||||
package_extension: deb
|
||||
|
||||
name: deliver ${{ matrix.distrib }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
module_name: connector-vmware
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: connector-vmware
|
||||
distrib: ${{ matrix.distrib }}
|
||||
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 }}
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
@ -18,8 +18,16 @@ on:
|
||||
- ".github/docker/packaging/*"
|
||||
|
||||
jobs:
|
||||
create-and-push-docker:
|
||||
get-environment:
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
|
||||
dockerize:
|
||||
needs: [get-environment]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- runner: ubuntu-22.04
|
||||
@ -37,7 +45,7 @@ jobs:
|
||||
- runner: ubuntu-22.04
|
||||
dockerfile: packaging-plugins-bullseye
|
||||
image: packaging-plugins-bullseye
|
||||
- runner: ["self-hosted", "collect-arm64"]
|
||||
- runner: centreon-collect-arm64
|
||||
dockerfile: packaging-plugins-bullseye
|
||||
image: packaging-plugins-bullseye-arm64
|
||||
- runner: ubuntu-22.04
|
||||
@ -55,6 +63,12 @@ jobs:
|
||||
- runner: ubuntu-22.04
|
||||
dockerfile: packaging-plugins-java-jammy
|
||||
image: packaging-plugins-java-jammy
|
||||
- runner: ubuntu-22.04
|
||||
dockerfile: packaging-plugins-noble
|
||||
image: packaging-plugins-noble
|
||||
- runner: ubuntu-22.04
|
||||
dockerfile: packaging-plugins-java-noble
|
||||
image: packaging-plugins-java-noble
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
@ -66,19 +80,19 @@ jobs:
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||
|
||||
- name: Login to proxy registry
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||
|
||||
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
|
||||
- uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
||||
|
||||
- uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
|
||||
- uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
|
||||
with:
|
||||
file: .github/docker/packaging/Dockerfile.${{ matrix.dockerfile }}
|
||||
context: .
|
||||
@ -86,3 +100,12 @@ jobs:
|
||||
pull: true
|
||||
push: true
|
||||
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
|
||||
set-skip-label:
|
||||
needs: [get-environment, dockerize]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
@ -18,28 +18,40 @@ on:
|
||||
- ".github/docker/testing/*"
|
||||
|
||||
jobs:
|
||||
create-and-push-docker:
|
||||
get-environment:
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
|
||||
dockerize:
|
||||
needs: [get-environment]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- runner: ubuntu-22.04
|
||||
- runner: ubuntu-24.04
|
||||
dockerfile: alma8
|
||||
image: alma8
|
||||
- runner: ubuntu-22.04
|
||||
- runner: ubuntu-24.04
|
||||
dockerfile: alma9
|
||||
image: alma9
|
||||
- runner: ubuntu-22.04
|
||||
- runner: ubuntu-24.04
|
||||
dockerfile: bullseye
|
||||
image: bullseye
|
||||
- runner: ["self-hosted", "collect-arm64"]
|
||||
- runner: centreon-collect-arm64
|
||||
dockerfile: bullseye
|
||||
image: bullseye-arm64
|
||||
- runner: ubuntu-22.04
|
||||
- runner: ubuntu-24.04
|
||||
dockerfile: bookworm
|
||||
image: bookworm
|
||||
- runner: ubuntu-22.04
|
||||
- runner: ubuntu-24.04
|
||||
dockerfile: jammy
|
||||
image: jammy
|
||||
- runner: ubuntu-24.04
|
||||
dockerfile: noble
|
||||
image: noble
|
||||
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
@ -51,19 +63,19 @@ jobs:
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||
|
||||
- name: Login to proxy registry
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||
|
||||
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
|
||||
- uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
||||
|
||||
- uses: docker/build-push-action@5176d81f87c23d6fc96624dfdbcd9f3830bbe445 # v6.5.0
|
||||
- uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
|
||||
with:
|
||||
file: .github/docker/testing/Dockerfile.testing-plugins-${{ matrix.dockerfile }}
|
||||
context: .
|
||||
@ -71,3 +83,12 @@ jobs:
|
||||
pull: true
|
||||
push: true
|
||||
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/testing-plugins-${{ matrix.image }}:latest
|
||||
|
||||
set-skip-label:
|
||||
needs: [get-environment, dockerize]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
44
.github/workflows/docker-builder-unit-tests.yml
vendored
44
.github/workflows/docker-builder-unit-tests.yml
vendored
@ -18,8 +18,16 @@ on:
|
||||
- ".github/docker/unit-tests/*"
|
||||
|
||||
jobs:
|
||||
create-and-push-docker:
|
||||
get-environment:
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
|
||||
dockerize:
|
||||
needs: [get-environment]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- runner: ubuntu-22.04
|
||||
@ -31,9 +39,18 @@ jobs:
|
||||
- runner: ubuntu-22.04
|
||||
dockerfile: bullseye
|
||||
image: bullseye
|
||||
- runner: centreon-collect-arm64
|
||||
dockerfile: bullseye
|
||||
image: bullseye-arm64
|
||||
- runner: ubuntu-22.04
|
||||
dockerfile: bookworm
|
||||
image: bookworm
|
||||
- runner: ubuntu-22.04
|
||||
dockerfile: jammy
|
||||
image: jammy
|
||||
- runner: ubuntu-22.04
|
||||
dockerfile: noble
|
||||
image: noble
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
@ -42,22 +59,22 @@ jobs:
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||
|
||||
- name: Login to proxy registry
|
||||
uses: docker/login-action@0d4c9c5ea7693da7b068278f7b52bda2a190a446 # v3.2.0
|
||||
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||
with:
|
||||
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||
|
||||
- uses: docker/setup-buildx-action@d70bba72b1f3fd22344832f00baa16ece964efeb # v3.3.0
|
||||
- uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0
|
||||
|
||||
- uses: docker/build-push-action@15560696de535e4014efeff63c48f16952e52dd1 # v6.2.0
|
||||
- uses: docker/build-push-action@471d1dc4e07e5cdedd4c2171150001c434f0b7a4 # v6.15.0
|
||||
with:
|
||||
file: .github/docker/unit-tests/Dockerfile.unit-tests-${{ matrix.dockerfile }}
|
||||
context: .
|
||||
@ -65,3 +82,12 @@ jobs:
|
||||
pull: true
|
||||
push: true
|
||||
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/unit-tests-${{ matrix.image }}:latest
|
||||
|
||||
set-skip-label:
|
||||
needs: [get-environment, dockerize]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
402
.github/workflows/get-environment.yml
vendored
402
.github/workflows/get-environment.yml
vendored
@ -5,62 +5,370 @@ on:
|
||||
required: false
|
||||
type: string
|
||||
outputs:
|
||||
stability:
|
||||
description: "branch stability (stable, testing, unstable, canary)"
|
||||
value: ${{ jobs.get-version.outputs.stability }}
|
||||
version:
|
||||
description: "version"
|
||||
value: ${{ jobs.get-version.outputs.version }}
|
||||
value: ${{ jobs.get-environment.outputs.version }}
|
||||
release:
|
||||
description: "release number"
|
||||
value: ${{ jobs.get-version.outputs.release }}
|
||||
description: "release"
|
||||
value: ${{ jobs.get-environment.outputs.release }}
|
||||
stability:
|
||||
description: "branch stability (stable, testing, unstable, canary)"
|
||||
value: ${{ jobs.get-environment.outputs.stability }}
|
||||
target_stability:
|
||||
description: "Final target branch stability (stable, testing, unstable, canary or not defined if not a pull request)"
|
||||
value: ${{ jobs.get-environment.outputs.target_stability }}
|
||||
release_type:
|
||||
description: "type of release (hotfix, release or not defined if not a release)"
|
||||
value: ${{ jobs.get-environment.outputs.release_type }}
|
||||
is_targeting_feature_branch:
|
||||
description: "if it is a PR, check if targeting a feature branch"
|
||||
value: ${{ jobs.get-environment.outputs.is_targeting_feature_branch }}
|
||||
skip_workflow:
|
||||
description: "if the current workflow should be skipped"
|
||||
value: ${{ jobs.get-environment.outputs.skip_workflow }}
|
||||
labels:
|
||||
description: "list of labels on the PR"
|
||||
value: ${{ jobs.get-environment.outputs.labels }}
|
||||
|
||||
jobs:
|
||||
get-version:
|
||||
runs-on: ubuntu-22.04
|
||||
get-environment:
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
stability: ${{ steps.get_environment.outputs.stability }}
|
||||
version: ${{ steps.get_environment.outputs.version }}
|
||||
release: ${{ steps.get_environment.outputs.release }}
|
||||
version: ${{ steps.get_version.outputs.version }}
|
||||
release: ${{ steps.get_release.outputs.release }}
|
||||
stability: ${{ steps.get_stability.outputs.stability }}
|
||||
target_stability: ${{ steps.get_stability.outputs.target_stability }}
|
||||
release_type: ${{ steps.get_release_type.outputs.release_type }}
|
||||
is_targeting_feature_branch: ${{ steps.get_stability.outputs.is_targeting_feature_branch }}
|
||||
skip_workflow: ${{ steps.skip_workflow.outputs.result }}
|
||||
labels: ${{ steps.has_skip_label.outputs.labels }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- name: Check if PR has skip label
|
||||
id: has_skip_label
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
let hasSkipLabel = false;
|
||||
let labels = [];
|
||||
|
||||
- id: get_environment
|
||||
if (${{ contains(fromJSON('["pull_request", "pull_request_target"]') , github.event_name) }} === true) {
|
||||
try {
|
||||
const fetchedLabels = await github.rest.issues.listLabelsOnIssue({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number
|
||||
});
|
||||
fetchedLabels.data.forEach(({ name }) => {
|
||||
labels.push(name);
|
||||
if (name === '${{ format('skip-workflow-{0}', github.workflow) }}') {
|
||||
hasSkipLabel = true;
|
||||
}
|
||||
});
|
||||
} catch (e) {
|
||||
core.warning(`failed to list labels: ${e}`);
|
||||
}
|
||||
}
|
||||
|
||||
core.setOutput('labels', labels);
|
||||
|
||||
return hasSkipLabel;
|
||||
|
||||
- name: Checkout sources (current branch)
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
with:
|
||||
fetch-depth: ${{ steps.has_skip_label.outputs.result == 'true' && 100 || 1 }}
|
||||
|
||||
- if: ${{ steps.has_skip_label.outputs.result == 'true' }}
|
||||
name: Get workflow triggered paths
|
||||
id: get_workflow_triggered_paths
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const fs = require('fs');
|
||||
|
||||
let paths = [];
|
||||
|
||||
const workflowFilePath = '${{ github.workflow_ref }}'.replace('${{ github.repository }}/', '').split('@').shift();
|
||||
|
||||
if (fs.existsSync(workflowFilePath)) {
|
||||
const workflowFileContent = fs.readFileSync(workflowFilePath, 'utf8');
|
||||
const workflowFileContentLines = workflowFileContent.split('\n');
|
||||
|
||||
let hasReadOn = false;
|
||||
let hasReadPullRequest = false;
|
||||
let hasReadPaths = false;
|
||||
for (const line of workflowFileContentLines) {
|
||||
if (line.match(/^on:\s*$/)) {
|
||||
hasReadOn = true;
|
||||
continue;
|
||||
}
|
||||
if (line.match(/^\s{2}pull_request(_target)?:\s*$/)) {
|
||||
hasReadPullRequest = true;
|
||||
continue;
|
||||
}
|
||||
if (line.match(/^\s{4}paths:\s*$/)) {
|
||||
hasReadPaths = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hasReadOn && hasReadPullRequest && hasReadPaths) {
|
||||
const matches = line.match(/^\s{6}-\s['"](.+)['"]\s*$/);
|
||||
if (matches) {
|
||||
paths.push(matches[1].trim());
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (paths.length === 0) {
|
||||
paths = ['**'];
|
||||
}
|
||||
|
||||
console.log(paths);
|
||||
|
||||
return paths;
|
||||
|
||||
- if: ${{ steps.has_skip_label.outputs.result == 'true' }}
|
||||
name: Get push changes
|
||||
id: get_push_changes
|
||||
uses: tj-actions/changed-files@2f7c5bfce28377bc069a65ba478de0a74aa0ca32 # v46.0.1
|
||||
with:
|
||||
since_last_remote_commit: true
|
||||
json: true
|
||||
escape_json: false
|
||||
files: ${{ join(fromJSON(steps.get_workflow_triggered_paths.outputs.result), ';') }}
|
||||
files_separator: ';'
|
||||
|
||||
- name: Check if current workflow should be skipped
|
||||
id: skip_workflow
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
if (${{ steps.has_skip_label.outputs.result }} === false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const label = '${{ format('skip-workflow-{0}', github.workflow) }}';
|
||||
if ('${{ steps.get_push_changes.outputs.any_changed }}' === 'true') {
|
||||
try {
|
||||
await github.rest.issues.removeLabel({
|
||||
name: label,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number
|
||||
});
|
||||
core.notice(`label ${label} removed because changes were detected on last push.`);
|
||||
} catch (e) {
|
||||
core.warning(`failed to remove label ${label}: ${e}`);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
- if: ${{ github.event_name == 'pull_request' }}
|
||||
name: Get nested pull request path
|
||||
id: pr_path
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const prPath = ['${{ github.head_ref }}', '${{ github.base_ref }}'];
|
||||
|
||||
const result = await github.rest.pulls.list({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
per_page: 100,
|
||||
state: 'open'
|
||||
});
|
||||
|
||||
let found = true;
|
||||
while (found) {
|
||||
found = false;
|
||||
result.data.forEach(({ head: { ref: headRef }, base: { ref: baseRef} }) => {
|
||||
if (headRef === prPath[prPath.length - 1] && ! prPath.includes(baseRef)) {
|
||||
found = true;
|
||||
prPath.push(baseRef);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
return prPath;
|
||||
|
||||
- name: Get stability
|
||||
id: get_stability
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const getStability = (branchName) => {
|
||||
switch (true) {
|
||||
case /(^develop$)|(^dev-\d{2}\.\d{2}\.x$)/.test(branchName):
|
||||
return 'unstable';
|
||||
case /(^release.+)|(^hotfix.+)/.test(branchName):
|
||||
return 'testing';
|
||||
case /(^master$)|(^\d{2}\.\d{2}\.x$)/.test(branchName):
|
||||
return 'stable';
|
||||
default:
|
||||
return 'canary';
|
||||
}
|
||||
};
|
||||
|
||||
core.setOutput('stability', getStability('${{ github.head_ref || github.ref_name }}'));
|
||||
|
||||
let isTargetingFeatureBranch = false;
|
||||
if ("${{ github.event_name }}" === "pull_request") {
|
||||
let targetStability = 'canary';
|
||||
const prPath = ${{ steps.pr_path.outputs.result || '[]' }};
|
||||
prPath.shift(); // remove current branch
|
||||
|
||||
if (prPath.length && getStability(prPath[0]) === 'canary') {
|
||||
isTargetingFeatureBranch = true;
|
||||
}
|
||||
|
||||
prPath.every((branchName) => {
|
||||
console.log(`checking stability of ${branchName}`)
|
||||
targetStability = getStability(branchName);
|
||||
|
||||
if (targetStability !== 'canary') {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
core.setOutput('target_stability', targetStability);
|
||||
}
|
||||
|
||||
core.setOutput('is_targeting_feature_branch', isTargetingFeatureBranch);
|
||||
|
||||
- name: Get version
|
||||
id: get_version
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const { execSync } = require('child_process');
|
||||
const fs = require('fs');
|
||||
let version = '';
|
||||
if ('${{ inputs.version_file }}'.match(/pom\.xml$/)) {
|
||||
version = execSync(`grep -m 1 "<version>.*</version>" ${{ inputs.version_file }} | sed 's/.*<version>\\(.*\\)<\\/version>.*/\\1/'`).toString().trim();
|
||||
|
||||
} else if ('${{ steps.get_stability.outputs.stability }}' === 'stable') {
|
||||
const { owner, repo } = context.repo;
|
||||
|
||||
// Fetch the most recent tag for plugins
|
||||
const { data: tags } = await github.rest.repos.listTags({
|
||||
owner,
|
||||
repo,
|
||||
per_page: 10
|
||||
});
|
||||
|
||||
let latestTag = null;
|
||||
let latestDate = 0;
|
||||
|
||||
// Filter tags matching format plugins-YYYYMMDD
|
||||
for (const tag of tags) {
|
||||
const match = tag.name.match(/^plugins-(\d{8})$/);
|
||||
|
||||
const tagDate = parseInt(match[1], 10);
|
||||
|
||||
// ensure we get the true latest tag and not the most recent created
|
||||
if (tagDate > latestDate) {
|
||||
latestTag = tag.name;
|
||||
latestDate = tagDate;
|
||||
}
|
||||
}
|
||||
|
||||
console.log(`Most recent tag found: ${latestTag}`)
|
||||
|
||||
// Get current release tag from .version file
|
||||
version = fs.readFileSync('.version.plugins', 'utf8').trim();
|
||||
|
||||
console.log(`Stable version based on .version.plugins file will be: ${version}`)
|
||||
|
||||
} else if ('${{ steps.get_stability.outputs.stability }}' === 'testing') {
|
||||
const branchName = "${{ github.head_ref || github.ref_name }}";
|
||||
const matches = branchName.match(/^(?:release|hotfix)-(\d{8})$/);
|
||||
if (matches) {
|
||||
version = matches[1];
|
||||
} else {
|
||||
throw new Error('invalid version');
|
||||
}
|
||||
} else if ('${{ steps.get_stability.outputs.stability }}' === 'unstable') {
|
||||
const currentDate = new Date();
|
||||
version = `${currentDate.getFullYear()}${("0" + (currentDate.getMonth() + 1)).slice(-2)}${String(currentDate.getDate()).padStart(2, '0')}`;
|
||||
} else {
|
||||
const currentDate = new Date();
|
||||
version = `${currentDate.getFullYear()}${("0" + (currentDate.getMonth() + 1)).slice(-2)}00`;
|
||||
}
|
||||
|
||||
core.setOutput('version', version);
|
||||
|
||||
- name: "Get release: 1 for testing / stable, <date> for others"
|
||||
id: get_release
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
let release = '';
|
||||
|
||||
if (${{ contains(fromJSON('["testing", "unstable"]') , steps.get_stability.outputs.stability) }} === true) {
|
||||
release = "1"
|
||||
} else {
|
||||
release = Date.now()
|
||||
}
|
||||
|
||||
core.setOutput('release', release);
|
||||
|
||||
- name: "Get release type: hotfix, release or not defined if not a release"
|
||||
id: get_release_type
|
||||
run: |
|
||||
if [[ -z "$GITHUB_HEAD_REF" ]]; then
|
||||
BRANCHNAME="$GITHUB_REF_NAME"
|
||||
else
|
||||
BRANCHNAME="$GITHUB_HEAD_REF"
|
||||
RELEASE_TYPE=$(echo "${{ github.head_ref || github.ref_name }}" | cut -d '-' -f 1)
|
||||
if [[ "$RELEASE_TYPE" == "hotfix" || "$RELEASE_TYPE" == "release" ]]; then
|
||||
echo "release_type=$RELEASE_TYPE" >> $GITHUB_OUTPUT
|
||||
fi
|
||||
|
||||
case "$BRANCHNAME" in
|
||||
develop)
|
||||
STABILITY="unstable"
|
||||
;;
|
||||
release* | hotfix*)
|
||||
STABILITY="testing"
|
||||
;;
|
||||
master)
|
||||
STABILITY="stable"
|
||||
;;
|
||||
*)
|
||||
STABILITY="canary"
|
||||
;;
|
||||
esac
|
||||
|
||||
echo "stability=$STABILITY" >> $GITHUB_OUTPUT
|
||||
|
||||
if [[ "${{ inputs.version_file }}" == "" ]]; then
|
||||
VERSION=$(date '+%Y%m%d')
|
||||
elif [[ "${{ inputs.version_file }}" == */*.yaml ]]; then
|
||||
VERSION=$(grep 'version: ' ${{ inputs.version_file }} | cut -d' ' -f2 | tr -d '"')
|
||||
else
|
||||
VERSION=$(grep VERSION ${{ inputs.version_file }} | cut -d "'" -f 2)
|
||||
fi
|
||||
echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT
|
||||
|
||||
RELEASE=$(date '+%H%M%S')
|
||||
echo "release=$(echo $RELEASE)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- name: Display info in job summary
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const outputTable = [
|
||||
[{data: 'Name', header: true}, {data: 'Value', header: true}],
|
||||
['version', '${{ steps.get_version.outputs.version }}'],
|
||||
['release', '${{ steps.get_release.outputs.release }}'],
|
||||
['stability', '${{ steps.get_stability.outputs.stability }}'],
|
||||
['release_type', '${{ steps.get_release_type.outputs.release_type || '<em>not defined because this is not a release</em>' }}'],
|
||||
['is_targeting_feature_branch', '${{ steps.get_stability.outputs.is_targeting_feature_branch }}'],
|
||||
['target_stability', '${{ steps.get_stability.outputs.target_stability || '<em>not defined because current run is not triggered by pull request event</em>' }}'],
|
||||
['skip_workflow', '${{ steps.skip_workflow.outputs.result }}'],
|
||||
['labels', '${{ steps.has_skip_label.outputs.labels }}'],
|
||||
];
|
||||
core.summary
|
||||
.addHeading(`${context.workflow} environment outputs`)
|
||||
.addTable(outputTable);
|
||||
|
||||
if ("${{ github.event_name }}" === "pull_request") {
|
||||
const prPath = ${{ steps.pr_path.outputs.result || '[]' }};
|
||||
const mainBranchName = prPath.pop();
|
||||
let codeBlock = `
|
||||
%%{ init: { 'gitGraph': { 'mainBranchName': '${mainBranchName}', 'showCommitLabel': false } } }%%
|
||||
gitGraph
|
||||
commit`;
|
||||
prPath.reverse().forEach((branchName) => {
|
||||
codeBlock = `${codeBlock}
|
||||
branch ${branchName}
|
||||
checkout ${branchName}
|
||||
commit`;
|
||||
});
|
||||
|
||||
core.summary
|
||||
.addHeading('Git workflow')
|
||||
.addCodeBlock(
|
||||
codeBlock,
|
||||
"mermaid"
|
||||
);
|
||||
}
|
||||
|
||||
core.summary.write();
|
||||
|
77
.github/workflows/nrpe.yml
vendored
77
.github/workflows/nrpe.yml
vendored
@ -24,7 +24,10 @@ jobs:
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
runs-on: ubuntu-22.04
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
@ -44,12 +47,15 @@ jobs:
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-jammy
|
||||
distrib: jammy
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-noble
|
||||
distrib: noble
|
||||
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
name: package ${{ matrix.distrib }}
|
||||
|
||||
@ -114,46 +120,53 @@ jobs:
|
||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-rpm:
|
||||
deliver-packages:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
- distrib: bullseye
|
||||
package_extension: deb
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
- distrib: jammy
|
||||
package_extension: deb
|
||||
- distrib: noble
|
||||
package_extension: deb
|
||||
|
||||
|
||||
name: deliver ${{ matrix.distrib }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
module_name: nrpe
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: nrpe
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
566
.github/workflows/perl-cpan-libraries.yml
vendored
566
.github/workflows/perl-cpan-libraries.yml
vendored
@ -24,7 +24,9 @@ jobs:
|
||||
|
||||
package-rpm:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
@ -36,16 +38,12 @@ jobs:
|
||||
"ARGV::Struct",
|
||||
"Authen::SASL::SASLprep",
|
||||
"Authen::SCRAM::Client",
|
||||
"boolean",
|
||||
"BSON",
|
||||
"BSON::XS",
|
||||
"Carp::Assert",
|
||||
"Clone",
|
||||
"Clone::Choose",
|
||||
"common::sense",
|
||||
"Config::AWS",
|
||||
"Convert::Binary::C",
|
||||
"Convert::EBCDIC",
|
||||
"Crypt::Argon2",
|
||||
"Crypt::Blowfish_PP",
|
||||
"Crypt::OpenSSL::AES",
|
||||
"DataStruct::Flat",
|
||||
@ -54,32 +52,24 @@ jobs:
|
||||
"Device::Modbus",
|
||||
"Device::Modbus::RTU::Client",
|
||||
"Device::Modbus::TCP::Client",
|
||||
"Digest::MD5::File",
|
||||
"Digest::SHA1",
|
||||
"Email::Send::SMTP::Gmail",
|
||||
"Exporter::Shiny",
|
||||
"EV",
|
||||
"Exporter::Tiny", # Required by JSON::Path: the version available in the official repositories doesn't work with the last version of JSON::Path
|
||||
"FFI::CheckLib",
|
||||
"FFI::Platypus",
|
||||
"File::SearchPath",
|
||||
"Hash::Merge",
|
||||
"Hash::Ordered",
|
||||
"HTTP::Daemon",
|
||||
"HTTP::Daemon::SSL",
|
||||
"HTTP::ProxyPAC",
|
||||
"JMX::Jmx4Perl",
|
||||
"JSON::Parse",
|
||||
"JSON::WebToken",
|
||||
"JSON::Path",
|
||||
"Libssh::Session",
|
||||
"LV",
|
||||
"MIME::Types",
|
||||
"Mojo::IOLoop::Signal",
|
||||
"MongoDB",
|
||||
"MooseX::ClassAttribute",
|
||||
"Net::Amazon::Signature::V4",
|
||||
"Net::Curl",
|
||||
"Net::DHCP",
|
||||
"Net::FTPSSL",
|
||||
"Net::HTTPTunnel",
|
||||
"Net::MQTT::Simple",
|
||||
"Net::NTP",
|
||||
"Net::SMTPS",
|
||||
"Net::SMTP_auth",
|
||||
@ -87,23 +77,17 @@ jobs:
|
||||
"Net::TFTP",
|
||||
"Paws",
|
||||
"PBKDF2::Tiny",
|
||||
"Schedule::Cron",
|
||||
"Statistics::Descriptive",
|
||||
"Statistics::Regression",
|
||||
"Sys::SigAction",
|
||||
"Term::Clui",
|
||||
"Term::ShellUI",
|
||||
"Unicode::Stringprep",
|
||||
"URI::Encode",
|
||||
"URI::Template",
|
||||
"URL::Encode",
|
||||
"URL::Encode::XS",
|
||||
"UUID",
|
||||
"UUID::URandom",
|
||||
"WWW::Selenium",
|
||||
"XML::Filter::BufferText",
|
||||
"XML::LibXML::Simple",
|
||||
"XML::SAX::Writer",
|
||||
"ZMQ::Constants",
|
||||
"ZMQ::FFI",
|
||||
"ZMQ::LibZMQ4"
|
||||
@ -114,6 +98,9 @@ jobs:
|
||||
- rpm_provides: ""
|
||||
- version: ""
|
||||
- spec_file: ""
|
||||
- no-auto-depends: "false"
|
||||
- preinstall_cpanlibs: ""
|
||||
- revision: "1"
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
image: packaging-plugins-alma8
|
||||
@ -122,23 +109,40 @@ jobs:
|
||||
image: packaging-plugins-alma9
|
||||
- name: "BSON"
|
||||
rpm_provides: "perl(BSON::Bytes) perl(BSON::Code) perl(BSON::DBRef) perl(BSON::OID) perl(BSON::Raw) perl(BSON::Regex) perl(BSON::Time) perl(BSON::Timestamp) perl(BSON::Types) perl(BSON)"
|
||||
- name: "Crypt::Argon2"
|
||||
preinstall_cpanlibs: "Dist::Build"
|
||||
rpm_provides: "perl-Crypt-Argon2-debuginfo perl(Crypt::Argon2)"
|
||||
revision: "2"
|
||||
- name: "DateTime::Format::Duration::ISO8601"
|
||||
rpm_provides: "perl(DateTime-Format-Duration-ISO8601)"
|
||||
- name: "Device::Modbus::RTU::Client"
|
||||
version: "0.022"
|
||||
- name: "Device::Modbus::TCP::Client"
|
||||
version: "0.026"
|
||||
- name: "Exporter::Shiny"
|
||||
build_distribs: el8
|
||||
rpm_provides: "perl(Exporter::Shiny) perl(Exporter::Tiny)"
|
||||
- name: "FFI::CheckLib"
|
||||
rpm_dependencies: "perl(Env)"
|
||||
- name: "FFI::Platypus"
|
||||
rpm_provides: "perl(FFI::Platypus::Buffer) perl(FFI::Platypus::Memory)"
|
||||
rpm_dependencies: "perl(Capture::Tiny) perl(FFI::CheckLib) perl(File::Spec::Functions) perl(IPC::Cmd) perl(JSON::PP) perl(List::Util) perl(autodie) perl(constant) perl(parent)"
|
||||
no-auto-depends: true
|
||||
no-auto-depends: "true"
|
||||
- name: "Libssh::Session"
|
||||
rpm_dependencies: "libssh"
|
||||
rpm_provides: "perl-Libssh-Session-debuginfo perl(Libssh::Session) perl(Libssh::Sftp)"
|
||||
revision: "2"
|
||||
- name: "Mojo::IOLoop::Signal"
|
||||
rpm_dependencies: "perl-Mojolicious"
|
||||
rpm_provides: "perl(Mojo::IOLoop::Signal)"
|
||||
no-auto-depends: "true"
|
||||
- name: "Net::Curl"
|
||||
rpm_dependencies: "libcurl"
|
||||
rpm_provides: "perl-Net-Curl-debuginfo perl(Net::Curl) perl(Net::Curl::Compat) perl(Net::Curl::Easy) perl(Net::Curl::Form) perl(Net::Curl::Multi) perl(Net::Curl::Share)"
|
||||
revision: "2"
|
||||
- name: "Net::DHCP"
|
||||
rpm_provides: "perl(Net::DHCP::Constants) perl(Net::DHCP::Packet)"
|
||||
- name: "Net::SMTPS"
|
||||
build_distribs: el9
|
||||
- name: "Statistics::Descriptive"
|
||||
build_distribs: el9
|
||||
- name: "Statistics::Regression"
|
||||
version: "0.53"
|
||||
- name: "URL::Encode::XS"
|
||||
@ -152,59 +156,61 @@ jobs:
|
||||
- name: "ZMQ::LibZMQ4"
|
||||
version: "0.01"
|
||||
rpm_dependencies: "zeromq"
|
||||
- name: "Mojo::IOLoop::Signal"
|
||||
rpm_dependencies: "perl-Mojolicious"
|
||||
rpm_provides: "perl(Mojo::IOLoop::Signal)"
|
||||
no-auto-depends: true
|
||||
|
||||
|
||||
name: package ${{ matrix.distrib }} ${{ matrix.name }}
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
steps:
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
name: Get package infos
|
||||
id: package-infos
|
||||
run: |
|
||||
yum install -y yum-utils epel-release git
|
||||
yum config-manager --set-enabled crb || true # alma 9
|
||||
yum config-manager --set-enabled powertools || true # alma 8
|
||||
yum install -y cpanminus rpm-build libcurl-devel libssh-devel expat-devel gcc libuuid-devel zeromq-devel libxml2-devel libffi-devel perl-DBI perl-Net-Pcap freetds freetds-devel perl-Module-Build-Tiny
|
||||
|
||||
dnf module reset -y ruby
|
||||
dnf module enable -y ruby:3.1
|
||||
dnf install -y ruby ruby-devel
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
repository: kduret/fpm
|
||||
ref: fix-rpm-perl-dependency-name-unchanged
|
||||
path: fpm
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
name: Build and install fpm # waiting https://github.com/jordansissel/fpm/pull/2066
|
||||
run: |
|
||||
dnf install -y bsdtar
|
||||
cd fpm
|
||||
gem install bundler
|
||||
bundle install
|
||||
make install
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file == '' }}
|
||||
run: |
|
||||
cpan_info=$(cpanm --info ${{ matrix.name }})
|
||||
if [ -z "${{ matrix.version }}" ]; then
|
||||
PACKAGE_VERSION=""
|
||||
CPAN_PACKAGE_VERSION=$(echo $cpan_info | sed 's/\.tar\.gz$//' | sed 's/.*\-//')
|
||||
if [[ ! $CPAN_PACKAGE_VERSION =~ ^[v0-9]+\.[0-9]+ ]]; then
|
||||
echo "::error::Invalid version number: ${CPAN_PACKAGE_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
PACKAGE_VERSION="${CPAN_PACKAGE_VERSION}"
|
||||
else
|
||||
PACKAGE_VERSION=" -v ${{ matrix.version }}"
|
||||
PACKAGE_VERSION="${{ matrix.version }}"
|
||||
fi
|
||||
echo "package_version=$(echo $PACKAGE_VERSION)" >> $GITHUB_OUTPUT
|
||||
CPAN_PACKAGE_NAME=$(echo $cpan_info | sed 's/.*\///g' | sed 's/-[0-9\.]*\.tar\.gz//g')
|
||||
PACKAGE_NAME="perl-$CPAN_PACKAGE_NAME"
|
||||
echo "package_name=$(echo $PACKAGE_NAME)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
name: Check if package already exists
|
||||
id: check-package-existence
|
||||
run: |
|
||||
package_info=$(dnf provides 'perl(${{ matrix.name }})' 2>&1 | tr '[:upper:]' '[:lower:]' || true)
|
||||
do_not_build="false"
|
||||
if [[ ! $package_info =~ "no matches found" ]]; then
|
||||
package_version=$(echo $package_info | grep -oP "perl\($(echo ${{ matrix.name }} | tr '[:upper:]' '[:lower:]')\) = \K[0-9]+\.[0-9]+")
|
||||
if [[ "$package_version" == "${{ steps.package-infos.outputs.package_version }}" || "v$package_version" == "${{ steps.package-infos.outputs.package_version }}" ]]; then
|
||||
echo "::warning::Package ${{ matrix.name }} already exists in the official ${{ matrix.distrib }} repository with the same version."
|
||||
do_not_build="true"
|
||||
else
|
||||
echo "::warning::Package ${{ matrix.name }} exists in the official ${{ matrix.distrib }} repository with a different version."
|
||||
do_not_build="false"
|
||||
fi
|
||||
fi
|
||||
echo "do_not_build=$do_not_build" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file == '' }}
|
||||
run: |
|
||||
PACKAGE_VERSION=" -v ${{ steps.package-infos.outputs.package_version }}"
|
||||
|
||||
if [ -z "${{ matrix.rpm_dependencies }}" ]; then
|
||||
PACKAGE_DEPENDENCIES=""
|
||||
@ -214,7 +220,7 @@ jobs:
|
||||
done
|
||||
fi
|
||||
|
||||
if [ ! -z "${{ matrix.no-auto-depends }}" ]; then
|
||||
if [ "${{ matrix.no-auto-depends }}" == "true" ]; then
|
||||
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --no-auto-depends"
|
||||
fi
|
||||
|
||||
@ -226,15 +232,25 @@ jobs:
|
||||
done
|
||||
fi
|
||||
|
||||
cpanm Module::Build::Tiny
|
||||
cpanm Module::Install
|
||||
for CPANLIB_PREINSTALL in `echo "${{ matrix.preinstall_cpanlibs }}"`; do
|
||||
cpanm $CPANLIB_PREINSTALL
|
||||
done
|
||||
|
||||
export SYBASE="/usr"
|
||||
|
||||
fpm -s cpan -t ${{ matrix.package_extension }} --rpm-dist ${{ matrix.distrib }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES$PACKAGE_VERSION ${{ matrix.name }}
|
||||
temp_file=$(mktemp)
|
||||
echo "default.local" | tee /etc/mailname
|
||||
created_package=$(fpm -s cpan -t ${{ matrix.package_extension }} --rpm-dist ${{ matrix.distrib }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES$PACKAGE_VERSION --iteration ${{ matrix.revision }} ${{ matrix.name }} | tee "$temp_file" | grep "Created package" | grep -oP '(?<=:path=>").*?(?=")')
|
||||
# Check package name
|
||||
if [ -z "$created_package" ]; then
|
||||
echo "Error: fpm command failed"
|
||||
exit 1
|
||||
fi
|
||||
# Check rpm
|
||||
rpm2cpio $created_package | cpio -t
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file != '' }}
|
||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file != '' }}
|
||||
run: |
|
||||
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
||||
|
||||
@ -243,7 +259,7 @@ jobs:
|
||||
cp -r ~/rpmbuild/RPMS/noarch/*.rpm .
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) }}
|
||||
name: Replace '::' with - in the feature path
|
||||
id: package-name
|
||||
run: |
|
||||
@ -253,15 +269,18 @@ jobs:
|
||||
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) }}
|
||||
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash }}
|
||||
path: ./*.${{ matrix.package_extension }}
|
||||
retention-days: 1
|
||||
|
||||
merge-package-rpm-artifacts:
|
||||
needs: [package-rpm]
|
||||
needs: [get-environment, package-rpm]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
matrix:
|
||||
@ -269,7 +288,7 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Merge Artifacts
|
||||
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact/merge@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: packages-rpm-${{ matrix.distrib }}
|
||||
pattern: packages-rpm-${{ matrix.distrib }}-*
|
||||
@ -277,13 +296,16 @@ jobs:
|
||||
retention-days: 1
|
||||
|
||||
- name: Delete merged artifacts
|
||||
uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 # v5.0.0
|
||||
uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0
|
||||
with:
|
||||
name: packages-rpm-${{ matrix.distrib }}-*
|
||||
failOnError: false
|
||||
|
||||
sign-rpm:
|
||||
needs: [merge-package-rpm-artifacts]
|
||||
needs: [get-environment, merge-package-rpm-artifacts]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
@ -301,9 +323,9 @@ jobs:
|
||||
- run: apt-get install -y zstd
|
||||
shell: bash
|
||||
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||
- uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
|
||||
with:
|
||||
name: packages-rpm-${{ matrix.distrib }}
|
||||
path: ./
|
||||
@ -314,151 +336,210 @@ jobs:
|
||||
- run: rpmsign --addsign ./*.rpm
|
||||
shell: bash
|
||||
|
||||
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.rpm
|
||||
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
|
||||
deliver-rpm:
|
||||
needs: [get-environment, sign-rpm]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
with:
|
||||
module_name: perl-cpan-libraries
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
package-deb:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
|
||||
runs-on: ${{ matrix.runner_name }}
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [packaging-plugins-bullseye, packaging-plugins-bookworm, packaging-plugins-jammy, packaging-plugins-bullseye-arm64]
|
||||
image: [packaging-plugins-bullseye, packaging-plugins-bookworm, packaging-plugins-jammy, packaging-plugins-noble, packaging-plugins-bullseye-arm64]
|
||||
name:
|
||||
[
|
||||
"ARGV::Struct",
|
||||
"Authen::SCRAM::Client",
|
||||
"Config::AWS",
|
||||
"Convert::EBCDIC",
|
||||
"Crypt::Argon2",
|
||||
"Crypt::Blowfish_PP",
|
||||
"Crypt::OpenSSL::AES",
|
||||
"DataStruct::Flat",
|
||||
"DateTime::Format::Duration::ISO8601",
|
||||
"Device::Modbus",
|
||||
"Device::Modbus::RTU::Client",
|
||||
"Device::Modbus::TCP::Client",
|
||||
"Digest::SHA1",
|
||||
"Email::Send::SMTP::Gmail",
|
||||
"Hash::Ordered",
|
||||
"HTTP::ProxyPAC",
|
||||
"JMX::Jmx4Perl",
|
||||
"Libssh::Session",
|
||||
"Mojo::IOLoop::Signal",
|
||||
"Net::Amazon::Signature::V4",
|
||||
"Net::Curl",
|
||||
"Net::FTPSSL",
|
||||
"Net::HTTPTunnel",
|
||||
"Net::MQTT::Simple",
|
||||
"Net::SMTP_auth",
|
||||
"Paws",
|
||||
"Statistics::Regression",
|
||||
"WWW::Selenium",
|
||||
"XS::Loader",
|
||||
"ZMQ::Constants",
|
||||
"ZMQ::LibZMQ4"
|
||||
]
|
||||
include:
|
||||
- runner_name: ubuntu-24.04
|
||||
- arch: amd64
|
||||
- build_distribs: "bullseye,bookworm,jammy"
|
||||
- build_names: "bullseye-amd64,bookworm,jammy,noble"
|
||||
- deb_dependencies: ""
|
||||
- rpm_provides: ""
|
||||
- deb_provides: ""
|
||||
- version: ""
|
||||
- use_dh_make_perl: "true"
|
||||
- spec_file: ""
|
||||
- distrib: bullseye
|
||||
- no-auto-depends: "false"
|
||||
- preinstall_cpanlibs: ""
|
||||
- revision: "1"
|
||||
- build_name: bullseye-amd64
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
image: packaging-plugins-bullseye
|
||||
- distrib: bookworm
|
||||
- build_name: bookworm
|
||||
distrib: bookworm
|
||||
package_extension: deb
|
||||
image: packaging-plugins-bookworm
|
||||
- distrib: jammy
|
||||
- build_name: jammy
|
||||
distrib: jammy
|
||||
package_extension: deb
|
||||
image: packaging-plugins-jammy
|
||||
- distrib: bullseye
|
||||
- build_name: noble
|
||||
distrib: noble
|
||||
package_extension: deb
|
||||
image: packaging-plugins-noble
|
||||
- build_name: bullseye-arm64
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
image: packaging-plugins-bullseye-arm64
|
||||
arch: arm64
|
||||
runner_name: ["self-hosted", "collect-arm64"]
|
||||
runner_name: centreon-collect-arm64
|
||||
- name: "Crypt::Argon2"
|
||||
build_names: "bullseye-amd64,jammy,noble,bullseye-arm64"
|
||||
preinstall_cpanlibs: "Dist::Build"
|
||||
use_dh_make_perl: "false"
|
||||
no-auto-depends: "true"
|
||||
deb_dependencies: "libexporter-tiny-perl libtime-hires-perl libxsloader-perl"
|
||||
deb_provides: "libcrypt-argon2-perl-dbgsym"
|
||||
revision: "2"
|
||||
- name: "Crypt::OpenSSL::AES"
|
||||
use_dh_make_perl: "false"
|
||||
deb_dependencies: "libexporter-tiny-perl libxs-install-perl"
|
||||
no-auto-depends: "true"
|
||||
build_names: "bullseye-amd64,bookworm,jammy,noble,bullseye-arm64"
|
||||
- name: "Device::Modbus::RTU::Client"
|
||||
build_names: "bookworm"
|
||||
- name: "Device::Modbus::TCP::Client"
|
||||
build_names: "bookworm"
|
||||
- name: "Digest::SHA1"
|
||||
build_names: "jammy,noble"
|
||||
- name: "Libssh::Session"
|
||||
use_dh_make_perl: "false"
|
||||
build_names: "bullseye-amd64,bookworm,jammy,noble,bullseye-arm64"
|
||||
no-auto-depends: "true"
|
||||
deb_dependencies: "libcarp-assert-perl libdynaloader-functions-perl libexporter-tiny-perl libdevel-overloadinfo-perl libssh-4 libc6"
|
||||
deb_provides: "libssh-session-perl-dbgsym libssh-session-sftp"
|
||||
revision: "2"
|
||||
- name: "Net::Amazon::Signature::V4"
|
||||
build_distribs: ["bullseye", "jammy"]
|
||||
build_names: ["bullseye-amd64", "jammy", "noble"]
|
||||
- name: "Net::Curl"
|
||||
use_dh_make_perl: "false"
|
||||
build_names: "bullseye-amd64,bookworm,jammy,noble,bullseye-arm64"
|
||||
no-auto-depends: "true"
|
||||
deb_dependencies: "libcarp-assert-perl libdynaloader-functions-perl libexporter-tiny-perl libdevel-overloadinfo-perl libcurl4"
|
||||
deb_provides: "libnet-curl-perl-dbgsym libnet-curl-compat-perl libnet-curl-easy-perl libnet-curl-form-perl libnet-curl-share-perl libnet-curl-multi-perl"
|
||||
revision: "2"
|
||||
- name: "Net::MQTT::Simple"
|
||||
version: "1.29"
|
||||
- name: "Paws"
|
||||
use_dh_make_perl: "false"
|
||||
deb_dependencies: "libmoose-perl libmoosex-classattribute-perl libjson-maybexs-perl liburl-encode-perl libargv-struct-perl libmoo-perl libtype-tiny-perl libdatastruct-flat-perl libmodule-find-perl libthrowable-perl liburi-template-perl libnet-amazon-signature-v4-perl"
|
||||
no-auto-depends: true
|
||||
no-auto-depends: "true"
|
||||
- name: "Statistics::Regression"
|
||||
build_distribs: "bullseye"
|
||||
build_names: "bullseye-amd64"
|
||||
version: "0.53"
|
||||
- name: "ZMQ::LibZMQ4"
|
||||
use_dh_make_perl: "false"
|
||||
version: "0.01"
|
||||
deb_dependencies: "libzmq5"
|
||||
build_names: "bullseye-amd64,bookworm,jammy,noble,bullseye-arm64"
|
||||
name: package ${{ matrix.distrib }} ${{ matrix.arch }} ${{ matrix.name }}
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
steps:
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- if: ${{ contains(matrix.build_names, matrix.build_name) }}
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
- if: ${{ contains(matrix.build_names, matrix.build_name) }}
|
||||
name: Parse distrib name
|
||||
id: parse-distrib
|
||||
uses: ./.github/actions/parse-distrib
|
||||
with:
|
||||
distrib: ${{ matrix.distrib }}
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
name: Get package version
|
||||
id: package-version
|
||||
- if: ${{ contains(matrix.build_names, matrix.build_name) }}
|
||||
name: Get package infos
|
||||
id: package-infos
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y cpanminus
|
||||
|
||||
cpan_info=$(cpanm --info ${{ matrix.name }})
|
||||
if [ -z "${{ matrix.version }}" ]; then
|
||||
CPAN_PACKAGE_VERSION=$(cpanm --info ${{ matrix.name }} | sed 's/\.tar\.gz$//' | sed 's/.*\-//' | sed 's/v//')
|
||||
|
||||
if [[ ! $CPAN_PACKAGE_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
||||
CPAN_PACKAGE_VERSION=$(echo $cpan_info | sed 's/\.tar\.gz$//' | sed 's/.*\-//')
|
||||
if [[ ! $CPAN_PACKAGE_VERSION =~ ^[v0-9]+\.[0-9]+ ]]; then
|
||||
echo "::error::Invalid version number: ${CPAN_PACKAGE_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
PACKAGE_VERSION="${CPAN_PACKAGE_VERSION}"
|
||||
else
|
||||
PACKAGE_VERSION="${{ matrix.version }}"
|
||||
fi
|
||||
|
||||
echo "package_version=$(echo $PACKAGE_VERSION)" >> $GITHUB_OUTPUT
|
||||
CPAN_PACKAGE_NAME=$(echo $cpan_info | sed 's/.*\///g' | sed 's/-[0-9\.]*\.tar\.gz//g' | tr '[:upper:]' '[:lower:]')
|
||||
|
||||
# Handle specific cases of libssh-session
|
||||
if [[ "$CPAN_PACKAGE_NAME" == "lib"* ]];then
|
||||
PACKAGE_NAME="$CPAN_PACKAGE_NAME-perl"
|
||||
else
|
||||
PACKAGE_NAME="lib$CPAN_PACKAGE_NAME-perl"
|
||||
fi
|
||||
|
||||
echo "package_name=$(echo $PACKAGE_NAME)" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'false' }}
|
||||
- if: ${{ contains(matrix.build_names, matrix.build_name) }}
|
||||
name: Check if package already exists
|
||||
id: check-package-existence
|
||||
run: |
|
||||
apt-get install -y ruby libcurl4-openssl-dev libssh-dev uuid-dev libczmq-dev
|
||||
package_info=$(apt-cache policy ${{ steps.package-infos.outputs.package_name }})
|
||||
if [[ -n $package_info && "${{ steps.package-infos.outputs.package_name }}" =~ "_" ]]; then
|
||||
package_info=$(apt-cache policy $(echo ${{ steps.package-infos.outputs.package_name }} | sed 's/_//g'))
|
||||
fi
|
||||
do_not_build="false"
|
||||
if [[ -n $package_info ]]; then
|
||||
candidate_version=$(echo "$package_info" | grep 'Candidate:' | awk '{print $2}')
|
||||
if [[ "$candidate_version" == "${{ steps.package-infos.outputs.package_version }}"* || "v$candidate_version" == "${{ steps.package-infos.outputs.package_version }}"* ]]; then
|
||||
echo "::warning::Package ${{ steps.package-infos.outputs.package_name }} already exists in the official ${{ matrix.distrib }} repository with the same version."
|
||||
do_not_build="true"
|
||||
else
|
||||
echo "::warning::Package ${{ steps.package-infos.outputs.package_name }} exists in the official ${{ matrix.distrib }} repository with a different version."
|
||||
do_not_build="false"
|
||||
fi
|
||||
fi
|
||||
echo "do_not_build=$do_not_build" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_names, matrix.build_name) && matrix.use_dh_make_perl == 'false' }}
|
||||
run: |
|
||||
# Install needed cpan libs
|
||||
for CPANLIB_PREINSTALL in `echo "${{ matrix.preinstall_cpanlibs }}"`; do
|
||||
cpanm $CPANLIB_PREINSTALL
|
||||
done
|
||||
if [ -z "${{ matrix.deb_dependencies }}" ]; then
|
||||
PACKAGE_DEPENDENCIES=""
|
||||
else
|
||||
@ -466,30 +547,57 @@ jobs:
|
||||
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends $PACKAGE_DEPENDENCY"
|
||||
done
|
||||
fi
|
||||
|
||||
if [ ! -z "${{ matrix.no-auto-depends }}" ]; then
|
||||
if [ "${{ matrix.no-auto-depends }}" == "true" ]; then
|
||||
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --no-auto-depends"
|
||||
fi
|
||||
|
||||
cpanm Module::Build::Tiny
|
||||
cpanm Module::Install
|
||||
if [ -z "${{ matrix.deb_provides }}" ]; then
|
||||
PACKAGE_PROVIDES=""
|
||||
else
|
||||
for PACKAGE_PROVIDE in `echo "${{ matrix.deb_provides }}"`; do
|
||||
PACKAGE_PROVIDES="$PACKAGE_PROVIDES --provides $PACKAGE_PROVIDE"
|
||||
done
|
||||
fi
|
||||
|
||||
gem install fpm
|
||||
# Patch to apply fpm fix for debian package generation while waiting for the official fix to be released.
|
||||
patch -i .github/patch/fpm-deb.rb.diff $(find / -type f -name "deb.rb")
|
||||
temp_file=$(mktemp)
|
||||
echo "default.local" | tee /etc/mailname
|
||||
|
||||
# Handle specific case for libssh-session
|
||||
if [[ "${{ matrix.name }}" == "Libssh::Session" ]]; then
|
||||
created_package=$(fpm -s cpan -t ${{ matrix.package_extension }} --deb-dist ${{ matrix.distrib }} --iteration ${{ matrix.revision }}${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES -v ${{ steps.package-infos.outputs.package_version }} --name ssh-session ${{ matrix.name }} | tee "$temp_file" | grep "Created package" | grep -oP '(?<=:path=>").*?(?=")') || { echo "Error: fpm command failed"; exit 1; }
|
||||
else
|
||||
created_package=$(fpm -s cpan -t ${{ matrix.package_extension }} --deb-dist ${{ matrix.distrib }} --iteration ${{ matrix.revision }}${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES$PACKAGE_PROVIDES -v ${{ steps.package-infos.outputs.package_version }} ${{ matrix.name }} | tee "$temp_file" | grep "Created package" | grep -oP '(?<=:path=>").*?(?=")') || { echo "Error: fpm command failed"; exit 1; }
|
||||
fi
|
||||
|
||||
# Check package name
|
||||
if [ -z "$created_package" ]; then
|
||||
echo "Error: fpm command failed"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check deb
|
||||
dpkg-deb --verbose --contents $created_package || { echo "Error: dpkg-deb failed for package $created_package"; exit 1; }
|
||||
|
||||
fpm -a native -s cpan -t ${{ matrix.package_extension }} --deb-dist ${{ matrix.distrib }} --iteration ${{ steps.parse-distrib.outputs.package_distrib_name }} --verbose --cpan-verbose --no-cpan-test$PACKAGE_DEPENDENCIES -v ${{ steps.package-version.outputs.package_version }} ${{ matrix.name }}
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'true' }}
|
||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_names, matrix.build_name) && matrix.use_dh_make_perl == 'true' }}
|
||||
run: |
|
||||
apt-get install -y libcurl4-openssl-dev dh-make-perl libssh-dev uuid-dev libczmq-dev libmodule-install-perl libmodule-build-tiny-perl
|
||||
# module-build-tiny is required for Mojo::IOLoop::Signal build.
|
||||
|
||||
DEB_BUILD_OPTIONS="nocheck nodocs notest" dh-make-perl make --dist ${{ matrix.distrib }} --build --version ${{ steps.package-version.outputs.package_version }}${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }} --cpan ${{ matrix.name }}
|
||||
# Install needed cpan libs
|
||||
for CPANLIB_PREINSTALL in `echo "${{ matrix.preinstall_cpanlibs }}"`; do
|
||||
cpanm $CPANLIB_PREINSTALL
|
||||
done
|
||||
temp_file=$(mktemp)
|
||||
created_package=$(DEB_BUILD_OPTIONS="nocheck nodocs notest" dh-make-perl make --dist ${{ matrix.distrib }} --build --version ${{ steps.package-infos.outputs.package_version }} --revision ${{ matrix.revision }}${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }} --cpan ${{ matrix.name }} | tee "$temp_file" | grep "building package" | grep -oP "(?<=in '..\/).*.deb(?=')") || { echo "Error: dh-make-perl command failed"; exit 1; }
|
||||
# Check package name
|
||||
if [ -z "$created_package" ]; then
|
||||
echo "Error: dh-make-perl command failed"
|
||||
exit 1
|
||||
fi
|
||||
# Check deb
|
||||
dpkg-deb --contents $created_package || { echo "Error: dpkg-deb failed for package $created_package"; exit 1; }
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_names, matrix.build_name) }}
|
||||
name: Replace '::' with - in the feature path
|
||||
id: package-name
|
||||
run: |
|
||||
@ -499,23 +607,26 @@ jobs:
|
||||
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT
|
||||
shell: bash
|
||||
|
||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_names, matrix.build_name) }}
|
||||
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ matrix.arch }}-${{ steps.package-name.outputs.name_with_dash}}
|
||||
path: ./*.${{ matrix.package_extension }}
|
||||
retention-days: 1
|
||||
|
||||
merge-package-deb-artifacts:
|
||||
needs: [package-deb]
|
||||
needs: [get-environment, package-deb]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
distrib: [bullseye, bookworm, jammy, noble]
|
||||
|
||||
steps:
|
||||
- name: Merge Artifacts
|
||||
uses: actions/upload-artifact/merge@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact/merge@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: packages-deb-${{ matrix.distrib }}
|
||||
pattern: packages-deb-${{ matrix.distrib }}-*
|
||||
@ -523,66 +634,141 @@ jobs:
|
||||
retention-days: 1
|
||||
|
||||
- name: Delete merged artifacts
|
||||
uses: geekyeggo/delete-artifact@24928e75e6e6590170563b8ddae9fac674508aa1 # v5.0.0
|
||||
uses: geekyeggo/delete-artifact@f275313e70c08f6120db482d7a6b98377786765b # v5.1.0
|
||||
with:
|
||||
name: packages-deb-${{ matrix.distrib }}-*
|
||||
failOnError: false
|
||||
|
||||
download-and-cache-deb:
|
||||
needs: [merge-package-deb-artifacts]
|
||||
needs: [get-environment, merge-package-deb-artifacts]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
distrib: [bullseye, bookworm, jammy, noble]
|
||||
steps:
|
||||
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||
- uses: actions/download-artifact@cc203385981b70ca67e1cc392babf9cc229d5806 # v4.1.9
|
||||
with:
|
||||
name: packages-deb-${{ matrix.distrib }}
|
||||
path: ./
|
||||
|
||||
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.deb
|
||||
key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, download-and-cache-deb]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
test-packages:
|
||||
needs: [get-environment, sign-rpm, download-and-cache-deb]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
include:
|
||||
- package_extension: rpm
|
||||
image: almalinux:8
|
||||
distrib: el8
|
||||
arch: amd64
|
||||
runner_name: ubuntu-24.04
|
||||
- package_extension: rpm
|
||||
image: almalinux:9
|
||||
distrib: el9
|
||||
arch: amd64
|
||||
runner_name: ubuntu-24.04
|
||||
- package_extension: deb
|
||||
image: debian:bullseye
|
||||
distrib: bullseye
|
||||
arch: amd64
|
||||
runner_name: ubuntu-24.04
|
||||
- package_extension: deb
|
||||
image: debian:bookworm
|
||||
distrib: bookworm
|
||||
arch: amd64
|
||||
runner_name: ubuntu-24.04
|
||||
- package_extension: deb
|
||||
image: ubuntu:jammy
|
||||
distrib: jammy
|
||||
arch: amd64
|
||||
runner_name: ubuntu-24.04
|
||||
- package_extension: deb
|
||||
image: ubuntu:noble
|
||||
arch: amd64
|
||||
runner_name: ubuntu-24.04
|
||||
- package_extension: deb
|
||||
image: debian:bullseye
|
||||
distrib: bullseye
|
||||
arch: arm64
|
||||
runner_name: centreon-collect-arm64
|
||||
|
||||
runs-on: ${{ matrix.runner_name }}
|
||||
container:
|
||||
image: ${{ matrix.image }}
|
||||
|
||||
name: Test perl CPAN libs packages on ${{ matrix.package_extension }} ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
steps:
|
||||
|
||||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Test packaged libs
|
||||
uses: ./.github/actions/test-cpan-libs
|
||||
with:
|
||||
package_extension: ${{ matrix.package_extension }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
arch: ${{ matrix.arch }}
|
||||
|
||||
- name: Upload error log
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: install_error_log_${{ matrix.distrib }}-${{ matrix.arch }}
|
||||
path: install_error_${{ matrix.distrib }}_${{ matrix.arch }}.log
|
||||
|
||||
deliver-packages:
|
||||
needs: [get-environment, sign-rpm, download-and-cache-deb, test-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
- distrib: bullseye
|
||||
package_extension: deb
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
- distrib: jammy
|
||||
package_extension: deb
|
||||
- distrib: noble
|
||||
package_extension: deb
|
||||
|
||||
name: deliver ${{ matrix.distrib }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
module_name: perl-cpan-libraries
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
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:
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
module: perl-cpan-libraries
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
228
.github/workflows/perl-crypt-argon2.yml
vendored
228
.github/workflows/perl-crypt-argon2.yml
vendored
@ -1,228 +0,0 @@
|
||||
name: perl-crypt-argon2
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- "dependencies/perl-crypt-argon2/**"
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- dev-[2-9][0-9].[0-9][0-9].x
|
||||
- master
|
||||
- "[2-9][0-9].[0-9][0-9].x"
|
||||
paths:
|
||||
- "dependencies/perl-crypt-argon2/**"
|
||||
tags:
|
||||
- perl-crypt-argon2-*
|
||||
|
||||
jobs:
|
||||
get-environment:
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- image: packaging-plugins-alma8
|
||||
distrib: el8
|
||||
package_extension: rpm
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-alma9
|
||||
distrib: el9
|
||||
package_extension: rpm
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bullseye
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bookworm
|
||||
distrib: bookworm
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-jammy
|
||||
distrib: jammy
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bullseye-arm64
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
runner: ["self-hosted", "collect-arm64"]
|
||||
arch: arm64
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
|
||||
name: package ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Install locally Crypt::Argon2
|
||||
run: |
|
||||
if [[ "${{ matrix.package_extension }}" == "deb" ]]; then
|
||||
apt-get update
|
||||
apt-get install -y cpanminus gcc
|
||||
else
|
||||
dnf install -y cpanminus gcc
|
||||
fi
|
||||
|
||||
cpanm -v -l /tmp Crypt::Argon2@0.020
|
||||
shell: bash
|
||||
|
||||
- name: Set package name and paths according to distrib
|
||||
run: |
|
||||
PERL_VERSION=$(perl -E "say $^V" | sed -E "s/v([0-9]+\.[0-9]+).+/\1/g")
|
||||
|
||||
echo "Perl version is $PERL_VERSION"
|
||||
|
||||
if [[ "${{ matrix.package_extension }}" == "deb" ]]; then
|
||||
NAME="libcrypt-argon2-perl"
|
||||
if [ "${{ matrix.arch }}" = "amd64" ]; then
|
||||
PERL_VENDORARCH="/usr/lib/x86_64-linux-gnu/perl/$PERL_VERSION"
|
||||
else
|
||||
PERL_VENDORARCH="/usr/lib/aarch64-linux-gnu/perl/$PERL_VERSION"
|
||||
fi
|
||||
else
|
||||
NAME="perl-Crypt-Argon2"
|
||||
if [ "${{ matrix.distrib }}" = "el8" ]; then
|
||||
PERL_VENDORARCH="/usr/local/lib64/perl5"
|
||||
else
|
||||
PERL_VENDORARCH="/usr/local/lib64/perl5/$PERL_VERSION"
|
||||
fi
|
||||
fi
|
||||
|
||||
sed -i "s/@NAME@/$NAME/g" dependencies/perl-crypt-argon2/perl-crypt-argon2.yaml
|
||||
sed -i "s#@PERL_VENDORARCH@#$PERL_VENDORARCH#g" dependencies/perl-crypt-argon2/perl-crypt-argon2.yaml
|
||||
|
||||
cat dependencies/perl-crypt-argon2/perl-crypt-argon2.yaml
|
||||
shell: bash
|
||||
|
||||
- name: Package
|
||||
uses: ./.github/actions/package-nfpm
|
||||
with:
|
||||
nfpm_file_pattern: "dependencies/perl-crypt-argon2/perl-crypt-argon2.yaml"
|
||||
distrib: ${{ matrix.distrib }}
|
||||
package_extension: ${{ matrix.package_extension }}
|
||||
arch: ${{ matrix.arch }}
|
||||
release: 1
|
||||
commit_hash: ${{ github.sha }}
|
||||
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-crypt-argon2-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
|
||||
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
|
||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
# set condition to true if artifacts are needed
|
||||
- if: ${{ false }}
|
||||
name: Upload package artifacts
|
||||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
with:
|
||||
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
|
||||
path: ./*.${{ matrix.package_extension}}
|
||||
retention-days: 1
|
||||
|
||||
deliver-rpm:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
|
||||
name: Deliver ${{ matrix.distrib }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
with:
|
||||
module_name: perl-crypt-argon2-amd64
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-rpm-perl-crypt-argon2-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bookworm
|
||||
arch: amd64
|
||||
- distrib: jammy
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: arm64
|
||||
|
||||
name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: perl-crypt-argon2-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-deb-perl-crypt-argon2-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
promote:
|
||||
needs: [get-environment]
|
||||
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distrib: el8
|
||||
arch: amd64
|
||||
- distrib: el9
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bookworm
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Promote ${{ matrix.distrib }} ${{ matrix.arch }} to stable
|
||||
uses: ./.github/actions/promote-to-stable
|
||||
with:
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
module: perl-crypt-argon2-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
118
.github/workflows/perl-filesys-smbclient.yml
vendored
118
.github/workflows/perl-filesys-smbclient.yml
vendored
@ -24,7 +24,9 @@ jobs:
|
||||
|
||||
package-rpm:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
@ -38,8 +40,8 @@ jobs:
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
@ -61,13 +63,16 @@ jobs:
|
||||
cp -r ~/rpmbuild/RPMS/x86_64/*.rpm .
|
||||
shell: bash
|
||||
|
||||
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.rpm
|
||||
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
|
||||
sign-rpm:
|
||||
needs: [package-rpm]
|
||||
needs: [get-environment, package-rpm]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
@ -92,7 +97,7 @@ jobs:
|
||||
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.rpm
|
||||
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
@ -103,14 +108,16 @@ jobs:
|
||||
- run: rpmsign --addsign ./*.rpm
|
||||
shell: bash
|
||||
|
||||
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.rpm
|
||||
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
|
||||
package-deb:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
@ -122,12 +129,15 @@ jobs:
|
||||
distrib: bookworm
|
||||
- image: packaging-plugins-jammy
|
||||
distrib: jammy
|
||||
- image: packaging-plugins-noble
|
||||
distrib: noble
|
||||
|
||||
name: package ${{ matrix.distrib }}
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
@ -148,71 +158,57 @@ jobs:
|
||||
DEB_BUILD_OPTIONS="nocheck nodocs notest noautodbgsym" dh-make-perl make --dist ${{ matrix.distrib }} --verbose --build --version 4.0${{ steps.parse-distrib.outputs.package_distrib_separator }}${{ steps.parse-distrib.outputs.package_distrib_name }} perl-filesys-smbclient/
|
||||
shell: bash
|
||||
|
||||
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.deb
|
||||
key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||
|
||||
deliver-rpm:
|
||||
needs: [get-environment, sign-rpm]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
deliver-packages:
|
||||
needs: [get-environment, sign-rpm, package-deb]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
- distrib: bullseye
|
||||
package_extension: deb
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
- distrib: jammy
|
||||
package_extension: deb
|
||||
- distrib: noble
|
||||
package_extension: deb
|
||||
|
||||
name: deliver ${{ matrix.distrib }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
module_name: perl-filesys-smbclient
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package-deb]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: perl-filesys-smbclient
|
||||
distrib: ${{ matrix.distrib }}
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
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: perl-filesys-smbclient
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
195
.github/workflows/perl-json-path.yml
vendored
195
.github/workflows/perl-json-path.yml
vendored
@ -1,195 +0,0 @@
|
||||
name: perl-json-path
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- "dependencies/perl-json-path/**"
|
||||
- ".github/workflows/perl-json-path.yml"
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- dev-[2-9][0-9].[0-9][0-9].x
|
||||
- master
|
||||
- "[2-9][0-9].[0-9][0-9].x"
|
||||
paths:
|
||||
- "dependencies/perl-json-path/**"
|
||||
- ".github/workflows/perl-json-path.yml"
|
||||
|
||||
jobs:
|
||||
get-environment:
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- image: packaging-plugins-alma8
|
||||
distrib: el8
|
||||
package_extension: rpm
|
||||
- image: packaging-plugins-alma9
|
||||
distrib: el9
|
||||
package_extension: rpm
|
||||
- image: packaging-plugins-bullseye
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
- image: packaging-plugins-bookworm
|
||||
distrib: bookworm
|
||||
package_extension: deb
|
||||
- image: packaging-plugins-jammy
|
||||
distrib: jammy
|
||||
package_extension: deb
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
|
||||
name: package ${{ matrix.distrib }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Install locally JSON::Path
|
||||
run: |
|
||||
if [[ "${{ matrix.package_extension }}" == "deb" ]]; then
|
||||
apt-get update
|
||||
apt-get install -y cpanminus gcc
|
||||
else
|
||||
dnf install -y cpanminus gcc
|
||||
fi
|
||||
|
||||
cpanm -v -l /tmp JSON::Path@1.0.4
|
||||
|
||||
shell: bash
|
||||
|
||||
- name: Set package name and paths according to distrib
|
||||
run: |
|
||||
VERSION="1.0.4"
|
||||
|
||||
PERL_VERSION=$(perl -E "say $^V" | sed -E "s/v([0-9]+\.[0-9]+).+/\1/g")
|
||||
|
||||
echo "Perl version is $PERL_VERSION"
|
||||
|
||||
if [[ "${{ matrix.package_extension }}" == "deb" ]]; then
|
||||
NAME="libjson-path-perl"
|
||||
PERL_VENDORLIB="/usr/share/perl5"
|
||||
else
|
||||
NAME="perl-JSON-Path"
|
||||
if [ "${{ matrix.distrib }}" = "el8" ]; then
|
||||
PERL_VENDORLIB="/usr/local/share/perl5"
|
||||
else
|
||||
PERL_VENDORLIB="/usr/local/share/perl5/$PERL_VERSION"
|
||||
fi
|
||||
fi
|
||||
|
||||
sed -i "s/@NAME@/$NAME/g" dependencies/perl-json-path/perl-json-path.yaml
|
||||
sed -i "s/@VERSION@/$VERSION/g" dependencies/perl-json-path/perl-json-path.yaml
|
||||
sed -i "s#@PERL_VENDORLIB@#$PERL_VENDORLIB#g" dependencies/perl-json-path/perl-json-path.yaml
|
||||
|
||||
cat dependencies/perl-json-path/perl-json-path.yaml
|
||||
shell: bash
|
||||
|
||||
- name: Package
|
||||
uses: ./.github/actions/package-nfpm
|
||||
with:
|
||||
nfpm_file_pattern: "dependencies/perl-json-path/perl-json-path.yaml"
|
||||
distrib: ${{ matrix.distrib }}
|
||||
package_extension: ${{ matrix.package_extension }}
|
||||
release: 3
|
||||
arch: all
|
||||
commit_hash: ${{ github.sha }}
|
||||
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-json-path-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }}
|
||||
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
|
||||
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
|
||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
# set condition to true if artifacts are needed
|
||||
- if: ${{ false }}
|
||||
name: Upload package artifacts
|
||||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
with:
|
||||
name: packages-${{ matrix.distrib }}
|
||||
path: ./*.${{ matrix.package_extension}}
|
||||
retention-days: 1
|
||||
|
||||
deliver-rpm:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
|
||||
name: Deliver ${{ matrix.distrib }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
with:
|
||||
module_name: perl-json-path
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-rpm-perl-json-path-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
|
||||
name: Deliver ${{ matrix.distrib }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: perl-json-path
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-deb-perl-json-path-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
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: perl-json-path
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
98
.github/workflows/perl-keepass-reader.yml
vendored
98
.github/workflows/perl-keepass-reader.yml
vendored
@ -27,6 +27,9 @@ jobs:
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@ -47,14 +50,17 @@ jobs:
|
||||
- image: packaging-plugins-jammy
|
||||
distrib: jammy
|
||||
package_extension: deb
|
||||
- image: packaging-plugins-noble
|
||||
distrib: noble
|
||||
package_extension: deb
|
||||
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
name: package ${{ matrix.distrib }}
|
||||
|
||||
@ -117,71 +123,51 @@ jobs:
|
||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
|
||||
deliver-rpm:
|
||||
deliver-packages:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
if: |
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
|
||||
name: Deliver ${{ matrix.distrib }}
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
- distrib: bullseye
|
||||
package_extension: deb
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
- distrib: jammy
|
||||
package_extension: deb
|
||||
- distrib: noble
|
||||
package_extension: deb
|
||||
|
||||
name: deliver ${{ matrix.distrib }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
module_name: ${{ env.module_name }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.run_id }}-rpm-${{ env.module_name }}-${{ matrix.distrib }}
|
||||
cache_key: cache-${{ github.run_id }}-${{ matrix.package_extension }}-${{ env.module_name }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
|
||||
name: Deliver ${{ matrix.distrib }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: ${{ env.module_name }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.run_id }}-deb-${{ env.module_name }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
promote:
|
||||
needs: [get-environment]
|
||||
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [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: ${{ env.module_name }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
226
.github/workflows/perl-libssh-session.yml
vendored
226
.github/workflows/perl-libssh-session.yml
vendored
@ -1,226 +0,0 @@
|
||||
name: perl-libssh-session
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- "dependencies/perl-libssh-session/**"
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- dev-[2-9][0-9].[0-9][0-9].x
|
||||
- master
|
||||
- "[2-9][0-9].[0-9][0-9].x"
|
||||
paths:
|
||||
- "dependencies/perl-libssh-session/**"
|
||||
|
||||
jobs:
|
||||
get-environment:
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- image: packaging-plugins-alma8
|
||||
distrib: el8
|
||||
package_extension: rpm
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-alma9
|
||||
distrib: el9
|
||||
package_extension: rpm
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bullseye
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bookworm
|
||||
distrib: bookworm
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-jammy
|
||||
distrib: jammy
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bullseye-arm64
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
runner: ["self-hosted", "collect-arm64"]
|
||||
arch: arm64
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
|
||||
name: package ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Install locally Libssh::Session
|
||||
run: |
|
||||
if [[ "${{ matrix.package_extension }}" == "deb" ]]; then
|
||||
apt-get update
|
||||
apt-get install -y cpanminus gcc libssh-dev
|
||||
else
|
||||
dnf install -y cpanminus gcc libssh-devel
|
||||
fi
|
||||
|
||||
cpanm -v -l /tmp Libssh::Session@0.8
|
||||
shell: bash
|
||||
|
||||
- name: Set package name and paths according to distrib
|
||||
run: |
|
||||
PERL_VERSION=$(perl -E "say $^V" | sed -E "s/v([0-9]+\.[0-9]+).+/\1/g")
|
||||
|
||||
echo "Perl version is $PERL_VERSION"
|
||||
|
||||
if [[ "${{ matrix.package_extension }}" == "deb" ]]; then
|
||||
NAME="libssh-session-perl"
|
||||
if [ "${{ matrix.arch }}" = "amd64" ]; then
|
||||
PERL_VENDORARCH="/usr/lib/x86_64-linux-gnu/perl/$PERL_VERSION"
|
||||
else
|
||||
PERL_VENDORARCH="/usr/lib/aarch64-linux-gnu/perl/$PERL_VERSION"
|
||||
fi
|
||||
else
|
||||
NAME="perl-Libssh-Session"
|
||||
if [ "${{ matrix.distrib }}" = "el8" ]; then
|
||||
PERL_VENDORARCH="/usr/local/lib64/perl5"
|
||||
else
|
||||
PERL_VENDORARCH="/usr/local/lib64/perl5/$PERL_VERSION"
|
||||
fi
|
||||
fi
|
||||
|
||||
sed -i "s/@NAME@/$NAME/g" dependencies/perl-libssh-session/perl-libssh-session.yaml
|
||||
sed -i "s#@PERL_VENDORARCH@#$PERL_VENDORARCH#g" dependencies/perl-libssh-session/perl-libssh-session.yaml
|
||||
|
||||
cat dependencies/perl-libssh-session/perl-libssh-session.yaml
|
||||
shell: bash
|
||||
|
||||
- name: Package
|
||||
uses: ./.github/actions/package-nfpm
|
||||
with:
|
||||
nfpm_file_pattern: "dependencies/perl-libssh-session/perl-libssh-session.yaml"
|
||||
distrib: ${{ matrix.distrib }}
|
||||
package_extension: ${{ matrix.package_extension }}
|
||||
arch: ${{ matrix.arch }}
|
||||
release: 5
|
||||
commit_hash: ${{ github.sha }}
|
||||
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-libssh-session-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
|
||||
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
|
||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
# set condition to true if artifacts are needed
|
||||
- if: ${{ false }}
|
||||
name: Upload package artifacts
|
||||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
with:
|
||||
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
|
||||
path: ./*.${{ matrix.package_extension}}
|
||||
retention-days: 1
|
||||
|
||||
deliver-rpm:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
|
||||
name: Deliver ${{ matrix.distrib }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
with:
|
||||
module_name: perl-libssh-session-amd64
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-rpm-perl-libssh-session-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: arm64
|
||||
- distrib: bookworm
|
||||
arch: amd64
|
||||
- distrib: jammy
|
||||
arch: amd64
|
||||
|
||||
name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: perl-libssh-session-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-deb-perl-libssh-session-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
promote:
|
||||
needs: [get-environment]
|
||||
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distrib: el8
|
||||
arch: amd64
|
||||
- distrib: el9
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bookworm
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Promote ${{ matrix.distrib }} ${{ matrix.arch }} to stable
|
||||
uses: ./.github/actions/promote-to-stable
|
||||
with:
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
module: perl-libssh-session-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
226
.github/workflows/perl-net-curl.yml
vendored
226
.github/workflows/perl-net-curl.yml
vendored
@ -1,226 +0,0 @@
|
||||
name: perl-net-curl
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
paths:
|
||||
- "dependencies/perl-net-curl/**"
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- dev-[2-9][0-9].[0-9][0-9].x
|
||||
- master
|
||||
- "[2-9][0-9].[0-9][0-9].x"
|
||||
paths:
|
||||
- "dependencies/perl-net-curl/**"
|
||||
|
||||
jobs:
|
||||
get-environment:
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- image: packaging-plugins-alma8
|
||||
distrib: el8
|
||||
package_extension: rpm
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-alma9
|
||||
distrib: el9
|
||||
package_extension: rpm
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bullseye
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bookworm
|
||||
distrib: bookworm
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-jammy
|
||||
distrib: jammy
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bullseye-arm64
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
runner: ["self-hosted", "collect-arm64"]
|
||||
arch: arm64
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
|
||||
name: package ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Install locally Net::Curl
|
||||
run: |
|
||||
if [[ "${{ matrix.package_extension }}" == "deb" ]]; then
|
||||
apt-get update
|
||||
apt-get install -y libcurl4-openssl-dev cpanminus gcc
|
||||
else
|
||||
dnf install -y libcurl-devel cpanminus gcc
|
||||
fi
|
||||
|
||||
cpanm -v -l /tmp Net::Curl@0.55
|
||||
shell: bash
|
||||
|
||||
- name: Set package name and paths according to distrib
|
||||
run: |
|
||||
PERL_VERSION=$(perl -E "say $^V" | sed -E "s/v([0-9]+\.[0-9]+).+/\1/g")
|
||||
|
||||
echo "Perl version is $PERL_VERSION"
|
||||
|
||||
if [[ "${{ matrix.package_extension }}" == "deb" ]]; then
|
||||
NAME="libnet-curl-perl"
|
||||
if [ "${{ matrix.arch }}" = "amd64" ]; then
|
||||
PERL_VENDORARCH="/usr/lib/x86_64-linux-gnu/perl/$PERL_VERSION"
|
||||
else
|
||||
PERL_VENDORARCH="/usr/lib/aarch64-linux-gnu/perl/$PERL_VERSION"
|
||||
fi
|
||||
else
|
||||
NAME="perl-Net-Curl"
|
||||
if [ "${{ matrix.distrib }}" = "el8" ]; then
|
||||
PERL_VENDORARCH="/usr/local/lib64/perl5"
|
||||
else
|
||||
PERL_VENDORARCH="/usr/local/lib64/perl5/$PERL_VERSION"
|
||||
fi
|
||||
fi
|
||||
|
||||
sed -i "s/@NAME@/$NAME/g" dependencies/perl-net-curl/perl-net-curl.yaml
|
||||
sed -i "s#@PERL_VENDORARCH@#$PERL_VENDORARCH#g" dependencies/perl-net-curl/perl-net-curl.yaml
|
||||
|
||||
cat dependencies/perl-net-curl/perl-net-curl.yaml
|
||||
shell: bash
|
||||
|
||||
- name: Package
|
||||
uses: ./.github/actions/package-nfpm
|
||||
with:
|
||||
nfpm_file_pattern: "dependencies/perl-net-curl/perl-net-curl.yaml"
|
||||
distrib: ${{ matrix.distrib }}
|
||||
package_extension: ${{ matrix.package_extension }}
|
||||
arch: ${{ matrix.arch }}
|
||||
commit_hash: ${{ github.sha }}
|
||||
release: 1
|
||||
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-net-curl-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
rpm_gpg_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
|
||||
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
|
||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
# set condition to true if artifacts are needed
|
||||
- if: ${{ false }}
|
||||
name: Upload package artifacts
|
||||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
with:
|
||||
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
|
||||
path: ./*.${{ matrix.package_extension }}
|
||||
retention-days: 1
|
||||
|
||||
deliver-rpm:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
|
||||
name: Deliver ${{ matrix.distrib }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
with:
|
||||
module_name: perl-net-curl-amd64
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-rpm-perl-net-curl-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bookworm
|
||||
arch: amd64
|
||||
- distrib: jammy
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: arm64
|
||||
|
||||
name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: perl-net-curl-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-deb-perl-net-curl-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
promote:
|
||||
needs: [get-environment]
|
||||
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distrib: el8
|
||||
arch: amd64
|
||||
- distrib: el9
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bookworm
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: arm64
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Promote ${{ matrix.distrib }} ${{ matrix.arch }} to stable
|
||||
uses: ./.github/actions/promote-to-stable
|
||||
with:
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
module: perl-net-curl-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
169
.github/workflows/perl-openwsman.yml
vendored
169
.github/workflows/perl-openwsman.yml
vendored
@ -22,7 +22,9 @@ jobs:
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@ -53,10 +55,15 @@ jobs:
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-noble
|
||||
distrib: noble
|
||||
package_extension: deb
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- image: packaging-plugins-bullseye-arm64
|
||||
distrib: bullseye
|
||||
package_extension: deb
|
||||
runner: ["self-hosted", "collect-arm64"]
|
||||
runner: centreon-collect-arm64
|
||||
arch: arm64
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
@ -64,8 +71,8 @@ jobs:
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
name: package ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
|
||||
@ -206,132 +213,68 @@ jobs:
|
||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-rpm:
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.${{ matrix.package_extension }}
|
||||
key: cache-${{ github.sha }}-${{ matrix.package_extension }}-wsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
|
||||
deliver-packages:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
|
||||
name: Deliver ${{ matrix.distrib }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery libwsman
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
with:
|
||||
module_name: libwsman-amd64
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-rpm-libwsman-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
- name: Delivery perl-openwsman
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
with:
|
||||
module_name: perl-openwsman-amd64
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-rpm-perl-openwsman-${{ matrix.distrib }}-amd64-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bookworm
|
||||
arch: amd64
|
||||
- distrib: jammy
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: arm64
|
||||
|
||||
name: Deliver ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery sblim-sfcc
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: sblim-sfcc-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-deb-sblim-sfcc-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
- name: Delivery libwsman
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: libwsman-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-deb-libwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
- name: Delivery perl-openwsman
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: perl-openwsman-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: cache-${{ github.sha }}-deb-perl-openwsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
promote:
|
||||
needs: [get-environment]
|
||||
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
arch: amd64
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
package_extension: deb
|
||||
arch: arm64
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
arch: amd64
|
||||
- distrib: jammy
|
||||
package_extension: deb
|
||||
arch: amd64
|
||||
- distrib: noble
|
||||
package_extension: deb
|
||||
arch: amd64
|
||||
|
||||
|
||||
name: deliver ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Promote sblim-sfcc ${{ matrix.distrib }} ${{ matrix.arch }} to stable
|
||||
if: ${{ contains(fromJSON('["bullseye", "bookworm", "jammy"]'), matrix.distrib) }}
|
||||
uses: ./.github/actions/promote-to-stable
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
module: sblim-sfcc-${{ matrix.arch }}
|
||||
module_name: wsman-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
arch: ${{ matrix.arch }}
|
||||
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-wsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
|
||||
- name: Promote libwsman ${{ matrix.distrib }} ${{ matrix.arch }} to stable
|
||||
uses: ./.github/actions/promote-to-stable
|
||||
with:
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
module: libwsman-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
- name: Promote perl-openwsman ${{ matrix.distrib }} ${{ matrix.arch }} to stable
|
||||
uses: ./.github/actions/promote-to-stable
|
||||
with:
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
module: perl-openwsman-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
121
.github/workflows/perl-vmware-vsphere.yml
vendored
121
.github/workflows/perl-vmware-vsphere.yml
vendored
@ -24,7 +24,9 @@ jobs:
|
||||
|
||||
get-sources:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- name: Download vsphere cli sources
|
||||
@ -41,13 +43,16 @@ jobs:
|
||||
shell: bash
|
||||
|
||||
- name: Cache vsphere cli sources
|
||||
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: vmware-vsphere-cli-distrib
|
||||
key: ${{ github.sha }}-${{ github.run_id }}-sources-perl-vmware-vsphere
|
||||
|
||||
package:
|
||||
needs: [get-environment, get-sources]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
@ -77,10 +82,15 @@ jobs:
|
||||
distrib: jammy
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-noble
|
||||
distrib: noble
|
||||
runner: ubuntu-22.04
|
||||
arch: amd64
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-bullseye-arm64
|
||||
distrib: bullseye
|
||||
runner: ["self-hosted", "collect-arm64"]
|
||||
runner: centreon-collect-arm64
|
||||
arch: arm64
|
||||
|
||||
runs-on: ${{ matrix.runner }}
|
||||
@ -88,8 +98,8 @@ jobs:
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
name: package ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
|
||||
@ -98,7 +108,7 @@ jobs:
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Import source files
|
||||
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: vmware-vsphere-cli-distrib
|
||||
key: ${{ github.sha }}-${{ github.run_id }}-sources-perl-vmware-vsphere
|
||||
@ -145,84 +155,59 @@ jobs:
|
||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-rpm:
|
||||
deliver-packages:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
with:
|
||||
module_name: perl-vmware-vsphere-amd64
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}-amd64
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
|
||||
deliver-deb:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
include:
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: arm64
|
||||
- distrib: bookworm
|
||||
arch: amd64
|
||||
- distrib: jammy
|
||||
arch: amd64
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: perl-vmware-vsphere-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}-${{ matrix.arch }}
|
||||
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]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
arch: amd64
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
arch: amd64
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
arch: amd64
|
||||
- distrib: bullseye
|
||||
package_extension: deb
|
||||
arch: arm64
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
arch: amd64
|
||||
- distrib: jammy
|
||||
package_extension: deb
|
||||
arch: amd64
|
||||
|
||||
name: deliver ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Promote ${{ matrix.distrib }} ${{ matrix.arch }} to stable
|
||||
uses: ./.github/actions/promote-to-stable
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
module: perl-vmware-vsphere-${{ matrix.arch }}
|
||||
module_name: perl-vmware-vsphere-${{ matrix.arch }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
arch: ${{ matrix.arch }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ matrix.arch }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
77
.github/workflows/plink.yml
vendored
77
.github/workflows/plink.yml
vendored
@ -24,7 +24,9 @@ jobs:
|
||||
|
||||
package-rpm:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
@ -37,8 +39,8 @@ jobs:
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
@ -55,13 +57,16 @@ jobs:
|
||||
cp -r ~/rpmbuild/RPMS/x86_64/*.rpm .
|
||||
shell: bash
|
||||
|
||||
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.rpm
|
||||
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
|
||||
sign-rpm:
|
||||
needs: [package-rpm]
|
||||
needs: [get-environment, package-rpm]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
@ -86,7 +91,7 @@ jobs:
|
||||
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.rpm
|
||||
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
@ -97,55 +102,55 @@ jobs:
|
||||
- run: rpmsign --addsign ./*.rpm
|
||||
shell: bash
|
||||
|
||||
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./*.rpm
|
||||
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
|
||||
- uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
- uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: packages-${{ matrix.distrib }}
|
||||
path: ./*.rpm
|
||||
retention-days: 1
|
||||
|
||||
deliver-rpm:
|
||||
deliver-packages:
|
||||
needs: [get-environment, sign-rpm]
|
||||
if: ${{ contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
|
||||
name: deliver ${{ matrix.distrib }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
module_name: plink
|
||||
distrib: ${{ matrix.distrib }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
promote:
|
||||
needs: [get-environment]
|
||||
if: ${{ contains(fromJson('["stable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
strategy:
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Promote ${{ matrix.distrib }} to stable
|
||||
uses: ./.github/actions/promote-to-stable
|
||||
with:
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
module: plink
|
||||
distrib: ${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
160
.github/workflows/plugin-delivery.yml
vendored
160
.github/workflows/plugin-delivery.yml
vendored
@ -1,160 +0,0 @@
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
version:
|
||||
description: The package version
|
||||
type: string
|
||||
required: true
|
||||
release:
|
||||
description: The package release
|
||||
type: string
|
||||
required: true
|
||||
stability:
|
||||
description: The package stability (stable, testing, unstable)
|
||||
type: string
|
||||
required: true
|
||||
secrets:
|
||||
artifactory_token:
|
||||
description: "The artifactory token"
|
||||
required: true
|
||||
token_download_centreon_com:
|
||||
description: "The token to call download.centreon.com api"
|
||||
required: true
|
||||
|
||||
jobs:
|
||||
deliver-sources:
|
||||
runs-on: [self-hosted, common]
|
||||
if: ${{ contains(fromJson('["stable"]'), inputs.stability) && github.event_name != 'workflow_dispatch' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ./build/
|
||||
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: Deliver sources
|
||||
uses: ./.github/actions/release-sources
|
||||
with:
|
||||
bucket_directory: centreon-plugins
|
||||
module_directory: build
|
||||
module_name: centreon-plugins
|
||||
version: ${{ inputs.version }}
|
||||
release: ${{ inputs.release }}
|
||||
token_download_centreon_com: ${{ secrets.token_download_centreon_com }}
|
||||
|
||||
deliver-rpm:
|
||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||
runs-on: [self-hosted, common]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [el7, el8, el9]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
with:
|
||||
module_name: plugins
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
stability: ${{ inputs.stability }}
|
||||
artifactory_token: ${{ secrets.artifactory_token }}
|
||||
|
||||
deliver-rpm-legacy:
|
||||
if: ${{ inputs.stability == 'stable' && github.event_name != 'workflow_dispatch' }}
|
||||
runs-on: [self-hosted, common]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [el7, el8]
|
||||
major_version: ["21.10", "22.04", "22.10"]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery-legacy
|
||||
with:
|
||||
module_name: plugins
|
||||
major_version: ${{ matrix.major_version }}
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
stability: ${{ inputs.stability }}
|
||||
artifactory_token: ${{ secrets.artifactory_token }}
|
||||
|
||||
deliver-deb:
|
||||
if: ${{ github.event_name != 'workflow_dispatch' }}
|
||||
runs-on: [self-hosted, common]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [bullseye, bookworm, jammy]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery
|
||||
with:
|
||||
module_name: plugins
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||
stability: ${{ inputs.stability }}
|
||||
artifactory_token: ${{ secrets.artifactory_token }}
|
||||
|
||||
deliver-deb-legacy:
|
||||
if: ${{ inputs.stability == 'stable' && github.event_name != 'workflow_dispatch' }}
|
||||
runs-on: [self-hosted, common]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [bullseye]
|
||||
major_version: ["22.04", "22.10"]
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/deb-delivery-legacy
|
||||
with:
|
||||
module_name: plugins
|
||||
distrib: ${{ matrix.distrib }}
|
||||
major_version: ${{ matrix.major_version }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||
stability: ${{ inputs.stability }}
|
||||
artifactory_token: ${{ secrets.artifactory_token }}
|
||||
|
||||
release-tag:
|
||||
if: ${{ inputs.stability == 'stable' && github.event_name == 'push' }}
|
||||
runs-on: ubuntu-22.04
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- name: Push git release tag
|
||||
run: |
|
||||
RELEASE=plugins-$(date '+%Y%m%d')
|
||||
|
||||
EXISTING_TAG=$(git tag --list "$RELEASE" | head -n 1)
|
||||
|
||||
git config --global user.email "release@centreon.com"
|
||||
git config --global user.name "Centreon"
|
||||
|
||||
if [ -z "$EXISTING_TAG" ]; then
|
||||
git tag -a "$RELEASE" -m "release $RELEASE"
|
||||
git push --follow-tags
|
||||
else
|
||||
echo "::warning::Release tag $RELEASE already exists"
|
||||
fi
|
||||
shell: bash
|
43
.github/workflows/plugins-selinux.yml
vendored
43
.github/workflows/plugins-selinux.yml
vendored
@ -24,6 +24,9 @@ jobs:
|
||||
|
||||
package:
|
||||
needs: [get-environment]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable'
|
||||
runs-on: ubuntu-22.04
|
||||
strategy:
|
||||
matrix:
|
||||
@ -38,8 +41,8 @@ jobs:
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
name: package ${{ matrix.distrib }}
|
||||
|
||||
@ -69,24 +72,44 @@ jobs:
|
||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
|
||||
deliver-rpm:
|
||||
deliver-packages:
|
||||
needs: [get-environment, package]
|
||||
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
runs-on: [self-hosted, common]
|
||||
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
distrib: [el8, el9]
|
||||
include:
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
|
||||
name: deliver ${{ matrix.distrib }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/rpm-delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
module_name: plugins-selinux
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
229
.github/workflows/plugins.yml
vendored
229
.github/workflows/plugins.yml
vendored
@ -29,15 +29,15 @@ jobs:
|
||||
uses: ./.github/workflows/get-environment.yml
|
||||
|
||||
get-plugins:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
outputs:
|
||||
plugins: ${{ steps.get_plugins.outputs.plugins }}
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
fetch-depth: 0
|
||||
|
||||
- uses: actions/setup-python@39cd14951b08e74b54015e9e001cdefcf80e669f # v5.1.1
|
||||
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
|
||||
with:
|
||||
python-version: '3.9'
|
||||
|
||||
@ -89,12 +89,18 @@ jobs:
|
||||
|
||||
unit-tests:
|
||||
needs: [get-environment, get-plugins]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-environment.outputs.stability != 'stable' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [unit-tests-alma8, unit-tests-alma9, unit-tests-bullseye, unit-tests-bookworm]
|
||||
image: [unit-tests-alma8, unit-tests-alma9, unit-tests-bullseye, unit-tests-bullseye-arm64, unit-tests-bookworm, unit-tests-jammy, unit-tests-noble]
|
||||
include:
|
||||
- runner_name: ubuntu-22.04
|
||||
- runner_name: ubuntu-24.04
|
||||
- package_extension: rpm
|
||||
image: unit-tests-alma8
|
||||
distrib: el8
|
||||
@ -104,43 +110,57 @@ jobs:
|
||||
- package_extension: deb
|
||||
image: unit-tests-bullseye
|
||||
distrib: bullseye
|
||||
- package_extension: deb
|
||||
image: unit-tests-bullseye-arm64
|
||||
runner_name: centreon-collect-arm64
|
||||
distrib: bullseye
|
||||
- package_extension: deb
|
||||
image: unit-tests-bookworm
|
||||
distrib: bookworm
|
||||
- package_extension: deb
|
||||
image: unit-tests-jammy
|
||||
distrib: jammy
|
||||
- package_extension: deb
|
||||
image: unit-tests-noble
|
||||
distrib: noble
|
||||
|
||||
runs-on: ${{ matrix.runner_name }}
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Run unit tests
|
||||
uses: ./.github/actions/unit-tests
|
||||
|
||||
- name: Upload logs as artifacts if tests failed
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: plugin-installation-${{ matrix.distrib }}
|
||||
path: /tmp/*.jsonl
|
||||
path: ./lastlog.jsonl
|
||||
retention-days: 1
|
||||
|
||||
fatpacker:
|
||||
if: ${{ needs.get-plugins.outputs.plugins != '' }}
|
||||
needs: [get-environment, get-plugins, unit-tests]
|
||||
runs-on: ubuntu-22.04
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-plugins.outputs.plugins != '' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
with:
|
||||
fetch-depth: 1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Prepare FatPacker
|
||||
uses: shogo82148/actions-setup-perl@f551dafcc94572adc179bbddbb409b3ada8f8ff5 # v1.30.0
|
||||
uses: shogo82148/actions-setup-perl@49c14f24551d2de3bf56fb107a869c3760b1875e # v1.33.0
|
||||
with:
|
||||
perl-version: '5.34'
|
||||
install-modules-with: cpm
|
||||
@ -151,14 +171,21 @@ jobs:
|
||||
COMMIT=$(git log -1 HEAD --pretty=format:%h)
|
||||
perl .github/scripts/plugins-source.container.pl "${{ needs.get-plugins.outputs.plugins }}" "${{ needs.get-environment.outputs.version }} ($COMMIT)"
|
||||
|
||||
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/save@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./build/
|
||||
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
||||
|
||||
package:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
needs: [get-environment, get-plugins, fatpacker]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-plugins.outputs.plugins != '' &&
|
||||
needs.get-environment.outputs.stability != 'stable' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
@ -182,35 +209,23 @@ jobs:
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-jammy
|
||||
distrib: jammy
|
||||
- package_extension: deb
|
||||
image: packaging-plugins-noble
|
||||
distrib: noble
|
||||
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
|
||||
name: "package ${{ matrix.distrib }}"
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
if: ${{ matrix.distrib == 'el7' }}
|
||||
# el7 is not compatible with checkout v4 which uses node20
|
||||
uses: actions/checkout@f43a0e5ff2bd294095638e18286ca9a3d1956744 # v3.6.0
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Checkout sources
|
||||
if: ${{ matrix.distrib != 'el7' }}
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
|
||||
- if: ${{ matrix.distrib == 'el7' }}
|
||||
# el7 is not compatible with checkout v4 which uses node20
|
||||
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
with:
|
||||
path: ./build/
|
||||
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- if: ${{ matrix.distrib != 'el7' }}
|
||||
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||
- uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./build/
|
||||
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
||||
@ -292,12 +307,19 @@ jobs:
|
||||
|
||||
test-plugins:
|
||||
needs: [get-environment, get-plugins, package]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-plugins.outputs.plugins != '' &&
|
||||
needs.get-environment.outputs.stability != 'stable' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
image: [testing-plugins-alma8, testing-plugins-alma9, testing-plugins-jammy, testing-plugins-bullseye, testing-plugins-bookworm]
|
||||
image: [testing-plugins-alma8, testing-plugins-alma9, testing-plugins-jammy, testing-plugins-bullseye, testing-plugins-bookworm, testing-plugins-noble, testing-plugins-bullseye-arm64]
|
||||
include:
|
||||
- runner_name: ubuntu-22.04
|
||||
- runner_name: ubuntu-24.04
|
||||
- package_extension: rpm
|
||||
image: testing-plugins-alma8
|
||||
distrib: el8
|
||||
@ -313,21 +335,24 @@ jobs:
|
||||
- package_extension: deb
|
||||
image: testing-plugins-jammy
|
||||
distrib: jammy
|
||||
- package_extension: deb
|
||||
image: testing-plugins-noble
|
||||
distrib: noble
|
||||
- package_extension: deb
|
||||
image: testing-plugins-bullseye-arm64
|
||||
distrib: bullseye
|
||||
arch: arm64
|
||||
runner_name: ["self-hosted", "collect-arm64"]
|
||||
runner_name: centreon-collect-arm64
|
||||
|
||||
runs-on: ${{ matrix.runner_name }}
|
||||
container:
|
||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||
credentials:
|
||||
username: ${{ secrets.DOCKER_REGISTRY_ID }}
|
||||
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
|
||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- uses: ./.github/actions/test-plugins
|
||||
with:
|
||||
@ -337,20 +362,114 @@ jobs:
|
||||
|
||||
- name: Upload apt/dnf logs as artifacts if tests failed
|
||||
if: failure()
|
||||
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||
uses: actions/upload-artifact@6f51ac03b9356f520e9adb1b1b7802705f340c2b # v4.5.0
|
||||
with:
|
||||
name: plugin-installation-${{ matrix.distrib }}
|
||||
path: /var/log/robot-plugins-installation-tests.log
|
||||
retention-days: 1
|
||||
|
||||
deliver:
|
||||
needs: [get-environment, package, test-plugins]
|
||||
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
|
||||
uses: ./.github/workflows/plugin-delivery.yml
|
||||
with:
|
||||
version: ${{ needs.get-environment.outputs.version }}
|
||||
release: ${{ needs.get-environment.outputs.release }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
secrets:
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
token_download_centreon_com: ${{ secrets.TOKEN_DOWNLOAD_CENTREON_COM }}
|
||||
deliver-packages:
|
||||
needs: [get-environment, get-plugins, test-plugins]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
needs.get-plugins.outputs.plugins != '' &&
|
||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || (needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
include:
|
||||
- distrib: el7
|
||||
package_extension: rpm
|
||||
- distrib: el8
|
||||
package_extension: rpm
|
||||
- distrib: el9
|
||||
package_extension: rpm
|
||||
- distrib: bullseye
|
||||
package_extension: deb
|
||||
- distrib: bookworm
|
||||
package_extension: deb
|
||||
- distrib: jammy
|
||||
package_extension: deb
|
||||
- distrib: noble
|
||||
package_extension: deb
|
||||
|
||||
name: deliver ${{ matrix.distrib }}
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Delivery
|
||||
uses: ./.github/actions/package-delivery
|
||||
with:
|
||||
module_name: plugins
|
||||
distrib: ${{ matrix.distrib }}
|
||||
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||
stability: ${{ needs.get-environment.outputs.stability }}
|
||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||
|
||||
deliver-sources:
|
||||
needs: [get-environment, fatpacker]
|
||||
if: |
|
||||
needs.get-environment.outputs.stability == 'stable' &&
|
||||
github.event_name == 'push'
|
||||
runs-on: centreon-common
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- uses: actions/cache/restore@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
|
||||
with:
|
||||
path: ./build/
|
||||
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
||||
fail-on-cache-miss: true
|
||||
|
||||
- name: Deliver sources
|
||||
uses: ./.github/actions/release-sources
|
||||
with:
|
||||
bucket_directory: centreon-plugins
|
||||
module_directory: build
|
||||
module_name: centreon-plugins
|
||||
version: ${{ needs.get-environment.outputs.version }}
|
||||
release: ${{ needs.get-environment.outputs.release }}
|
||||
token_download_centreon_com: ${{ secrets.TOKEN_DOWNLOAD_CENTREON_COM }}
|
||||
|
||||
release-tag:
|
||||
needs: [get-environment]
|
||||
if: ${{ needs.get-environment.outputs.stability == 'stable' && github.event_name == 'push' }}
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Checkout sources
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
|
||||
- name: Push git release tag
|
||||
run: |
|
||||
RELEASE=plugins-${{ needs.get-environment.outputs.version }}
|
||||
|
||||
EXISTING_TAG=$(git tag --list "$RELEASE" | head -n 1)
|
||||
|
||||
git config --global user.email "release@centreon.com"
|
||||
git config --global user.name "Centreon"
|
||||
|
||||
if [ -z "$EXISTING_TAG" ]; then
|
||||
git tag -a "$RELEASE" -m "release $RELEASE"
|
||||
git push --follow-tags
|
||||
else
|
||||
echo "::warning::Release tag $RELEASE already exists"
|
||||
fi
|
||||
shell: bash
|
||||
|
||||
set-skip-label:
|
||||
needs: [get-environment, deliver-packages]
|
||||
if: |
|
||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
||||
! cancelled() &&
|
||||
! contains(needs.*.result, 'failure') &&
|
||||
! contains(needs.*.result, 'cancelled')
|
||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
||||
|
32
.github/workflows/set-pull-request-external-label.yml
vendored
Normal file
32
.github/workflows/set-pull-request-external-label.yml
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
name: set-pull-request-external-label
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||
cancel-in-progress: true
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
|
||||
jobs:
|
||||
set-pull-request-external-label:
|
||||
if: |
|
||||
github.event.pull_request.head.repo.fork &&
|
||||
! contains(github.event.pull_request.labels.*.name, 'external')
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Set PR external label
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const label = 'external';
|
||||
try {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
labels: [label]
|
||||
});
|
||||
} catch (e) {
|
||||
core.warning(`failed to add label ${label}: ${e}`);
|
||||
}
|
26
.github/workflows/set-pull-request-skip-label.yml
vendored
Normal file
26
.github/workflows/set-pull-request-skip-label.yml
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
name: set-pull-request-skip-label
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
|
||||
jobs:
|
||||
set-pull-request-skip-label:
|
||||
if: ${{ success() && contains(fromJSON('["pull_request", "pull_request_target"]') , github.event_name) }}
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Set PR skip label
|
||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||
with:
|
||||
script: |
|
||||
const label = '${{ format('skip-workflow-{0}', github.workflow) }}';
|
||||
try {
|
||||
await github.rest.issues.addLabels({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: context.issue.number,
|
||||
labels: [label]
|
||||
});
|
||||
} catch (e) {
|
||||
core.warning(`failed to add label ${label}: ${e}`);
|
||||
}
|
6
.github/workflows/spellchecker.yml
vendored
6
.github/workflows/spellchecker.yml
vendored
@ -15,7 +15,7 @@ on:
|
||||
jobs:
|
||||
pod-spell-check:
|
||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'do-not-spellcheck') }}
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||
@ -30,11 +30,11 @@ jobs:
|
||||
- added|modified: 'src/**/*.pm'
|
||||
|
||||
- name: Install CPAN Libraries
|
||||
uses: shogo82148/actions-setup-perl@f551dafcc94572adc179bbddbb409b3ada8f8ff5 # v1.30.0
|
||||
uses: shogo82148/actions-setup-perl@49c14f24551d2de3bf56fb107a869c3760b1875e # v1.33.0
|
||||
with:
|
||||
perl-version: '5.34'
|
||||
install-modules-with: cpm
|
||||
install-modules: Test::More Test::Spelling
|
||||
install-modules: Test::More Test::Spelling List::MoreUtils
|
||||
|
||||
- name: Install librairies
|
||||
continue-on-error: true
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,3 +1,5 @@
|
||||
log.html
|
||||
output.xml
|
||||
report.html
|
||||
.editorconfig
|
||||
.idea
|
||||
|
19
.gitleaks.toml
Normal file
19
.gitleaks.toml
Normal file
@ -0,0 +1,19 @@
|
||||
title = "Gitleaks custom rules"
|
||||
|
||||
[extend]
|
||||
useDefault = true
|
||||
|
||||
[allowlist]
|
||||
paths = [
|
||||
'''vendor\/''',
|
||||
'''(.*?)\.rptlibrary''',
|
||||
'''pnpm-lock\.yaml''',
|
||||
'''\.gitleaks\.toml$''',
|
||||
'''(.*?)(jpg|gif|doc|pdf|bin)$'''
|
||||
]
|
||||
|
||||
regexTarget = "match"
|
||||
regexes = [
|
||||
'''ABCDEFG1234567890''',
|
||||
'''s\.aBCD123DEF456GHI789JKL012'''
|
||||
]
|
1
.version.plugins
Normal file
1
.version.plugins
Normal file
@ -0,0 +1 @@
|
||||
20250303
|
@ -1,3 +1,9 @@
|
||||
2024-10-21 Pieter Kippes <pkippes@centreon.com> - 2.0.6
|
||||
* Fixed packaging issues with config files and java version
|
||||
|
||||
2024-10-18 Pieter Kippes <pkippes@centreon.com> - 2.0.5
|
||||
* Fixed packaging for config files
|
||||
|
||||
2024-10-11 Olivier Mercier <omercier@centreon.com> - 2.0.4
|
||||
* Use io.undertow 2.3.17
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
# centreon-as400 command line options
|
||||
JAVA_OPTS="-Xms128M -Xmx2G -XX:MaxPermSize=128m"
|
||||
JAVA_OPTS="-Xms128M -Xmx2G"
|
||||
CONNECTOR_OPTS="--port 8091"
|
||||
CONNECTOR_HOME=@CONNECTOR_HOME@
|
||||
CONNECTOR_ETC=@CONNECTOR_ETC@
|
||||
|
@ -3,7 +3,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.centreon.connector</groupId>
|
||||
<artifactId>centreon-as400</artifactId>
|
||||
<version>2.0.4</version>
|
||||
<version>2.0.6</version>
|
||||
<name>Centreon-AS/400</name>
|
||||
<description>Connecteur AS/400</description>
|
||||
<packaging>jar</packaging>
|
||||
@ -73,8 +73,8 @@
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.13.0</version>
|
||||
<configuration>
|
||||
<source>17</source>
|
||||
<target>17</target>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
|
@ -26,6 +26,7 @@ import java.text.NumberFormat;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.ibm.as400.access.AS400;
|
||||
import com.ibm.as400.access.SecureAS400;
|
||||
import com.ibm.as400.access.AS400SecurityException;
|
||||
import com.ibm.as400.access.ConnectionEvent;
|
||||
import com.ibm.as400.access.ConnectionListener;
|
||||
@ -44,11 +45,13 @@ public abstract class AbstractHandler {
|
||||
protected String host = null;
|
||||
protected String login = null;
|
||||
protected String password = null;
|
||||
protected Integer ssl = 0;
|
||||
|
||||
public AbstractHandler(final String host, final String login, final String password) {
|
||||
public AbstractHandler(final String host, final String login, final String password, final Integer ssl) {
|
||||
this.host = host;
|
||||
this.login = login;
|
||||
this.password = password;
|
||||
this.ssl = ssl;
|
||||
}
|
||||
|
||||
static {
|
||||
@ -77,7 +80,28 @@ public abstract class AbstractHandler {
|
||||
properties.setLoginTimeout(Conf.as400LoginTimeout);
|
||||
properties.setSoTimeout(Conf.as400ReadTimeout);
|
||||
|
||||
final AS400 system = new AS400(this.host, this.login, this.password);
|
||||
if (this.ssl == 1) {
|
||||
SecureAS400 system = new SecureAS400(this.host, this.login, this.password);
|
||||
system.setSocketProperties(properties);
|
||||
system.addConnectionListener(new ConnectionListener() {
|
||||
@Override
|
||||
public void connected(final ConnectionEvent event) {
|
||||
ConnectorLogger.getInstance().getLogger().debug("Connect event service : " + event.getService());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnected(final ConnectionEvent event) {
|
||||
ConnectorLogger.getInstance().getLogger().debug("Disconnect event service : " + event.getService());
|
||||
}
|
||||
});
|
||||
|
||||
system.validateSignon();
|
||||
|
||||
return (AS400)system;
|
||||
}
|
||||
|
||||
AS400 system = new AS400(this.host, this.login, this.password);
|
||||
|
||||
system.setSocketProperties(properties);
|
||||
system.addConnectionListener(new ConnectionListener() {
|
||||
@Override
|
||||
|
@ -34,8 +34,8 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
||||
*/
|
||||
public class CommandHandler extends AbstractHandler implements ICommandHandler {
|
||||
|
||||
public CommandHandler(final String host, final String login, final String password) {
|
||||
super(host, login, password);
|
||||
public CommandHandler(final String host, final String login, final String password, final Integer ssl) {
|
||||
super(host, login, password, ssl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -38,10 +38,10 @@ public class DiskHandler extends AbstractHandler implements IDiskHandler {
|
||||
|
||||
private QyaspolYasp0300PcmlHandler qyaspolPcmlHandler = null;
|
||||
|
||||
public DiskHandler(final String host, final String login, final String password)
|
||||
public DiskHandler(final String host, final String login, final String password, final Integer ssl)
|
||||
throws AS400SecurityException, IOException {
|
||||
super(host, login, password);
|
||||
this.qyaspolPcmlHandler = new QyaspolYasp0300PcmlHandler(host, login, password);
|
||||
super(host, login, password, ssl);
|
||||
this.qyaspolPcmlHandler = new QyaspolYasp0300PcmlHandler(host, login, password, ssl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,8 +37,8 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
||||
public class JobHandler extends AbstractHandler implements IJobHandler {
|
||||
private final JobCache jobCache;
|
||||
|
||||
public JobHandler(final String host, final String login, final String password) {
|
||||
super(host, login, password);
|
||||
public JobHandler(final String host, final String login, final String password, final Integer ssl) {
|
||||
super(host, login, password, ssl);
|
||||
this.jobCache = new JobCache(this);
|
||||
}
|
||||
|
||||
|
@ -37,8 +37,8 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
||||
*/
|
||||
public class JobQueueHandler extends AbstractHandler implements IJobQueueHandler {
|
||||
|
||||
public JobQueueHandler(final String host, final String login, final String password) {
|
||||
super(host, login, password);
|
||||
public JobQueueHandler(final String host, final String login, final String password, final Integer ssl) {
|
||||
super(host, login, password, ssl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,9 +42,9 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
||||
*/
|
||||
public class SubSystemHandler extends AbstractHandler implements ISubSystemHandler {
|
||||
|
||||
public SubSystemHandler(final String host, final String login, final String password)
|
||||
public SubSystemHandler(final String host, final String login, final String password, final Integer ssl)
|
||||
throws AS400SecurityException, IOException {
|
||||
super(host, login, password);
|
||||
super(host, login, password, ssl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -45,14 +45,14 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
||||
public class SystemHandler extends AbstractHandler implements ISystemHandler {
|
||||
private SystemStatus status = null;
|
||||
|
||||
public SystemHandler(final String host, final String login, final String password)
|
||||
public SystemHandler(final String host, final String login, final String password, final Integer ssl)
|
||||
throws AS400SecurityException, IOException {
|
||||
this(host, login, password, null);
|
||||
this(host, login, password, null, ssl);
|
||||
}
|
||||
|
||||
public SystemHandler(final String host, final String login, final String password, SystemStatus as400Status)
|
||||
public SystemHandler(final String host, final String login, final String password, SystemStatus as400Status, final Integer ssl)
|
||||
throws AS400SecurityException, IOException {
|
||||
super(host, login, password);
|
||||
super(host, login, password, ssl);
|
||||
this.status = as400Status == null ? new SystemStatus(getNewAs400()) : as400Status;
|
||||
}
|
||||
|
||||
|
@ -26,6 +26,7 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.ibm.as400.access.AS400;
|
||||
import com.ibm.as400.access.SecureAS400;
|
||||
import com.ibm.as400.access.AS400Message;
|
||||
import com.ibm.as400.access.AS400SecurityException;
|
||||
import com.ibm.as400.access.ConnectionEvent;
|
||||
@ -61,11 +62,13 @@ public class QyaspolYasp0300PcmlHandler {
|
||||
String host = null;
|
||||
String login = null;
|
||||
String password = null;
|
||||
Integer ssl = 0;
|
||||
|
||||
public QyaspolYasp0300PcmlHandler(final String host, final String login, final String password) {
|
||||
public QyaspolYasp0300PcmlHandler(final String host, final String login, final String password, final Integer ssl) {
|
||||
this.host = host;
|
||||
this.login = login;
|
||||
this.password = password;
|
||||
this.ssl = ssl;
|
||||
}
|
||||
|
||||
public void addYasp0300Data(final Yasp0300Data data) {
|
||||
@ -238,7 +241,27 @@ public class QyaspolYasp0300PcmlHandler {
|
||||
properties.setLoginTimeout(Conf.as400LoginTimeout);
|
||||
properties.setSoTimeout(Conf.as400ReadTimeout);
|
||||
|
||||
final AS400 system = new AS400(this.host, this.login, this.password);
|
||||
if (this.ssl == 1) {
|
||||
SecureAS400 system = new SecureAS400(this.host, this.login, this.password);
|
||||
system.setSocketProperties(properties);
|
||||
system.addConnectionListener(new ConnectionListener() {
|
||||
@Override
|
||||
public void connected(final ConnectionEvent event) {
|
||||
ConnectorLogger.getInstance().getLogger().debug("Connect event service : " + event.getService());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disconnected(final ConnectionEvent event) {
|
||||
ConnectorLogger.getInstance().getLogger().debug("Disconnect event service : " + event.getService());
|
||||
}
|
||||
});
|
||||
|
||||
system.validateSignon();
|
||||
|
||||
return (AS400)system;
|
||||
}
|
||||
|
||||
AS400 system = new AS400(this.host, this.login, this.password);
|
||||
system.setSocketProperties(properties);
|
||||
system.addConnectionListener(new ConnectionListener() {
|
||||
@Override
|
||||
|
@ -102,8 +102,8 @@ public class CachedMessageQueueHandler extends AbstractHandler implements ICache
|
||||
return sb.toString();
|
||||
}
|
||||
|
||||
public CachedMessageQueueHandler(final String host, final String login, final String password) {
|
||||
super(host, login, password);
|
||||
public CachedMessageQueueHandler(final String host, final String login, final String password, final Integer ssl) {
|
||||
super(host, login, password, ssl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -42,8 +42,8 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
||||
*/
|
||||
public class MessageQueueHandler extends AbstractHandler implements IMessageQueueHandler {
|
||||
|
||||
public MessageQueueHandler(final String host, final String login, final String password) {
|
||||
super(host, login, password);
|
||||
public MessageQueueHandler(final String host, final String login, final String password, final Integer ssl) {
|
||||
super(host, login, password, ssl);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -69,8 +69,8 @@ public class WorkWithProblemHandler extends AbstractHandler {
|
||||
private final boolean SSL = false;
|
||||
private final String logPrefix;
|
||||
|
||||
public WorkWithProblemHandler(final String host, final String login, final String password) {
|
||||
super(host, login, password);
|
||||
public WorkWithProblemHandler(final String host, final String login, final String password, final Integer ssl) {
|
||||
super(host, login, password, ssl);
|
||||
this.logPrefix = "[" + WorkWithProblemHandler.INSTANCE_ID++ + "]";
|
||||
}
|
||||
|
||||
|
@ -40,5 +40,7 @@ public interface IClient {
|
||||
|
||||
String getAs400CheckType();
|
||||
|
||||
Integer getAs400Ssl();
|
||||
|
||||
Object getAs400Arg(String key);
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ abstract class AbstractClient implements IClient {
|
||||
private String as400Password = null;
|
||||
private String as400CheckType = null;
|
||||
private String as400Args = null;
|
||||
private Integer as400Ssl = 0;
|
||||
private List<Map<String, String>> argList = new ArrayList<Map<String, String>>();
|
||||
|
||||
@Override
|
||||
@ -77,6 +78,11 @@ abstract class AbstractClient implements IClient {
|
||||
return this.input.getArg(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getAs400Ssl() {
|
||||
return this.input.getSsl();
|
||||
}
|
||||
|
||||
public List<Map<String , String>> getAs400ArgList(String key) {
|
||||
Object arg = this.input.getArg(key);
|
||||
if (arg == null) {
|
||||
|
@ -87,6 +87,7 @@ public class CheckDispatcher {
|
||||
private String host = null;
|
||||
private String login = null;
|
||||
private String password = null;
|
||||
private Integer ssl = 0;
|
||||
|
||||
private volatile ConcurrentHashMap<String, Long> filter = new ConcurrentHashMap<String, Long>();
|
||||
|
||||
@ -135,10 +136,11 @@ public class CheckDispatcher {
|
||||
}
|
||||
}
|
||||
|
||||
public CheckDispatcher(final String host, final String login, final String password) {
|
||||
public CheckDispatcher(final String host, final String login, final String password, final Integer ssl) {
|
||||
this.host = host;
|
||||
this.login = login;
|
||||
this.password = password;
|
||||
this.ssl = ssl;
|
||||
|
||||
this.executorGlobal = new ThreadPoolExecutorPostFilter(5, 10, Conf.workerQueueTimeout, TimeUnit.MILLISECONDS,
|
||||
new LinkedBlockingQueue<Runnable>());
|
||||
@ -165,6 +167,10 @@ public class CheckDispatcher {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
public Integer getSsl() {
|
||||
return this.ssl;
|
||||
}
|
||||
|
||||
public synchronized void dispatch(final NetworkClient client) {
|
||||
|
||||
if (this.filter.containsKey(client.getRawRequest())) {
|
||||
@ -190,52 +196,52 @@ public class CheckDispatcher {
|
||||
|
||||
public ICommandHandler getCommandHandler() throws AS400SecurityException, IOException {
|
||||
if (this.commandHandler == null) {
|
||||
this.commandHandler = new CommandHandler(this.host, this.login, this.password);
|
||||
this.commandHandler = new CommandHandler(this.host, this.login, this.password, this.ssl);
|
||||
}
|
||||
return this.commandHandler;
|
||||
}
|
||||
|
||||
public IDiskHandler getDiskHandler() throws AS400SecurityException, IOException {
|
||||
if (this.diskHandler == null) {
|
||||
this.diskHandler = new DiskHandler(this.host, this.login, this.password);
|
||||
this.diskHandler = new DiskHandler(this.host, this.login, this.password, this.ssl);
|
||||
}
|
||||
return this.diskHandler;
|
||||
}
|
||||
|
||||
public IJobHandler getJobHandler() throws AS400SecurityException, IOException {
|
||||
if (this.jobHandler == null) {
|
||||
this.jobHandler = new JobHandler(this.host, this.login, this.password);
|
||||
this.jobHandler = new JobHandler(this.host, this.login, this.password, this.ssl);
|
||||
}
|
||||
return this.jobHandler;
|
||||
}
|
||||
|
||||
public ISubSystemHandler getSubSystemHandler() throws AS400SecurityException, IOException {
|
||||
if (this.subSystemHandler == null) {
|
||||
this.subSystemHandler = new SubSystemHandler(this.host, this.login, this.password);
|
||||
this.subSystemHandler = new SubSystemHandler(this.host, this.login, this.password, this.ssl);
|
||||
}
|
||||
return this.subSystemHandler;
|
||||
}
|
||||
|
||||
public ISystemHandler getSystemHandler() throws AS400SecurityException, IOException {
|
||||
if (this.systemHandler == null) {
|
||||
this.systemHandler = new SystemHandler(this.host, this.login, this.password);
|
||||
this.systemHandler = new SystemHandler(this.host, this.login, this.password, this.ssl);
|
||||
}
|
||||
return this.systemHandler;
|
||||
}
|
||||
|
||||
public ICachedMessageQueueHandler getCachedMessageQueueHandler() throws AS400SecurityException, IOException {
|
||||
return new CachedMessageQueueHandler(this.host, this.login, this.password);
|
||||
return new CachedMessageQueueHandler(this.host, this.login, this.password, this.ssl);
|
||||
}
|
||||
|
||||
public IMessageQueueHandler getMessageQueueHandler() throws AS400SecurityException, IOException {
|
||||
return new MessageQueueHandler(this.host, this.login, this.password);
|
||||
return new MessageQueueHandler(this.host, this.login, this.password, this.ssl);
|
||||
}
|
||||
|
||||
public IJobQueueHandler getJobQueueHandler() throws AS400SecurityException, IOException {
|
||||
return new JobQueueHandler(this.host, this.login, this.password);
|
||||
return new JobQueueHandler(this.host, this.login, this.password, this.ssl);
|
||||
}
|
||||
|
||||
public WorkWithProblemHandler getWrkPrbHandler() throws AS400SecurityException, IOException {
|
||||
return new WorkWithProblemHandler(this.host, this.login, this.password);
|
||||
return new WorkWithProblemHandler(this.host, this.login, this.password, this.ssl);
|
||||
}
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ public class InputData {
|
||||
private String password = null;
|
||||
private String host = null;
|
||||
private String command = null;
|
||||
private Integer ssl = null;
|
||||
Map<String, Object> args = null;
|
||||
|
||||
public InputData() {
|
||||
@ -44,6 +45,13 @@ public class InputData {
|
||||
return this.password;
|
||||
}
|
||||
|
||||
public Integer getSsl() {
|
||||
if (this.ssl == null || this.ssl == 0) {
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
public String getHost() {
|
||||
return this.host;
|
||||
}
|
||||
|
@ -52,37 +52,37 @@ public class ClientDispatcherImpl implements ClientDispatcher {
|
||||
}
|
||||
|
||||
private synchronized CheckDispatcher createNewCheckDispatcher(final String host, final String login,
|
||||
final String password) throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
||||
final String password, final Integer ssl) throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
||||
|
||||
ConnectorLogger.getInstance().info("create new As400 : " + host);
|
||||
|
||||
CheckDispatcher resource = null;
|
||||
resource = new CheckDispatcher(host, login, password);
|
||||
resource = new CheckDispatcher(host, login, password, ssl);
|
||||
|
||||
this.pool.put(resource, System.currentTimeMillis());
|
||||
|
||||
return resource;
|
||||
}
|
||||
|
||||
private CheckDispatcher getAs400(final String host, final String login, final String password)
|
||||
private CheckDispatcher getAs400(final String host, final String login, final String password, final Integer ssl)
|
||||
throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
||||
|
||||
for (final CheckDispatcher resource : this.pool.keySet()) {
|
||||
if (resource.getHost().equalsIgnoreCase(host) && resource.getLogin().equalsIgnoreCase(login)
|
||||
&& resource.getPassword().equalsIgnoreCase(password)) {
|
||||
&& resource.getPassword().equalsIgnoreCase(password) && resource.getSsl() == ssl) {
|
||||
this.pool.put(resource, System.currentTimeMillis());
|
||||
return resource;
|
||||
}
|
||||
}
|
||||
|
||||
return this.createNewCheckDispatcher(host, login, password);
|
||||
return this.createNewCheckDispatcher(host, login, password, ssl);
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void dispatch(final NetworkClient client)
|
||||
throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
||||
final CheckDispatcher checkDispatcher = this.getAs400(client.getAs400Host(), client.getAs400Login(),
|
||||
client.getAs400Password());
|
||||
client.getAs400Password(), client.getAs400Ssl());
|
||||
checkDispatcher.dispatch(client);
|
||||
}
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ public class SystemHandlerTest {
|
||||
try {
|
||||
SystemStatus as400 = mock(SystemStatus.class);
|
||||
when(as400.getSystemPools()).thenReturn(new Vector<Object>().elements());
|
||||
SystemHandler sh = new SystemHandler(null, null, null, as400);
|
||||
SystemHandler sh = new SystemHandler(null, null, null, as400, null);
|
||||
sh.dumpSystem();
|
||||
} finally {
|
||||
System.setOut(originalOut);
|
||||
|
@ -2,7 +2,7 @@ name: "centreon-plugin-Operatingsystems-AS400-daemon"
|
||||
arch: "${ARCH}"
|
||||
platform: "linux"
|
||||
version_schema: "none"
|
||||
version: "2.0.4"
|
||||
version: "2.0.6"
|
||||
release: "${RELEASE}${DIST}"
|
||||
section: "default"
|
||||
priority: "optional"
|
||||
@ -14,8 +14,8 @@ homepage: "https://www.centreon.com"
|
||||
license: "Apache-2.0"
|
||||
|
||||
contents:
|
||||
- src: "../connector.as400/target/centreon-as400-${VERSION}-jar-with-dependencies.jar" # VARIABLE VERSION REQUIRED HERE
|
||||
dst: "/usr/share/centreon-as400/bin/centreon-as400-${VERSION}-jar-with-dependencies.jar" # VARIABLE VERSION REQUIRED HERE
|
||||
- src: "../connector.as400/target/centreon-as400-@CONNECTOR_VERSION@-jar-with-dependencies.jar" # VARIABLE VERSION REQUIRED HERE
|
||||
dst: "/usr/share/centreon-as400/bin/centreon-as400-@CONNECTOR_VERSION@-jar-with-dependencies.jar" # VARIABLE VERSION REQUIRED HERE
|
||||
expand: true
|
||||
file_info:
|
||||
mode: 0755
|
||||
@ -28,17 +28,20 @@ contents:
|
||||
mode: 0644
|
||||
|
||||
- src: "../connector.as400.install/init-script/centreon-as400-sysconfig"
|
||||
dst: "/etc/sysconfig/centreon-as400-sysconfig"
|
||||
dst: "/etc/sysconfig/centreon-as400"
|
||||
type: config|noreplace
|
||||
file_info:
|
||||
mode: 0644
|
||||
|
||||
- src: "../connector.as400.install/etc/config.properties"
|
||||
dst: "/etc/centreon-as400/config.properties"
|
||||
type: config|noreplace
|
||||
file_info:
|
||||
mode: 0644
|
||||
|
||||
- src: "../connector.as400.install/etc/log4j2.xml"
|
||||
dst: "/etc/centreon-as400/log4j2.xml"
|
||||
type: config|noreplace
|
||||
file_info:
|
||||
mode: 0644
|
||||
|
||||
@ -57,13 +60,13 @@ scripts:
|
||||
overrides:
|
||||
rpm:
|
||||
depends:
|
||||
- java-1.8.0-openjdk
|
||||
- "java-17-openjdk"
|
||||
deb:
|
||||
depends:
|
||||
- default-jre
|
||||
- "openjdk-17-jre"
|
||||
|
||||
rpm:
|
||||
summary: Centreon AS 400 Plugin daemon
|
||||
signature:
|
||||
key_file: ${RPM_SIGNING_KEY_FILE}
|
||||
key_id: ${RPM_SIGNING_KEY_ID}
|
||||
key_id: ${RPM_SIGNING_KEY_ID}
|
||||
|
@ -1,3 +1,15 @@
|
||||
2024-12-05 Olivier Mercier <omercier@centreon.com> - 3.4.0
|
||||
* Enhancement: systemd service now takes its options from
|
||||
/etc/(default|sysconfig)/centreon_vmware.
|
||||
* Enhancement: the existing .pm config file is converted into a .json file
|
||||
during upgrade.
|
||||
* Breaking: the default config file is now the JSON one.
|
||||
* Fix: added the 'perl(Text::Template)' missing dependency for AlmaLinux.
|
||||
|
||||
2024-10-18 Olivier Mercier <omercier@centreon.com> - 3.3.2
|
||||
* Fix: regression of case sensitiveness for container names fixed
|
||||
* Enhancement: log messages related to the vault have been downgraded from error to info level or explained as safe to ignore if not using the vault
|
||||
|
||||
2024-10-10 Olivier Mercier <omercier@centreon.com> - 3.3.1
|
||||
* Fix: add missing centreonvault.pm file to packaging
|
||||
|
||||
|
@ -69,18 +69,16 @@ contents:
|
||||
|
||||
- src: "redhat/centreon_vmware-sysconfig"
|
||||
dst: "/etc/sysconfig/centreon_vmware"
|
||||
type: config|noreplace
|
||||
packager: rpm
|
||||
- src: "debian/centreon_vmware-default"
|
||||
dst: "/etc/default/centreon_vmware"
|
||||
type: config|noreplace
|
||||
packager: deb
|
||||
|
||||
- src: "config/centreon_vmware-conf.pm"
|
||||
dst: "/etc/centreon/centreon_vmware.pm"
|
||||
- src: "config/centreon_vmware-conf.json"
|
||||
dst: "/etc/centreon/centreon_vmware.json"
|
||||
type: config|noreplace
|
||||
packager: rpm
|
||||
- src: "config/centreon_vmware-conf.pm"
|
||||
dst: "/etc/centreon/centreon_vmware.pm.new"
|
||||
packager: deb
|
||||
|
||||
scripts:
|
||||
postinstall: ./scripts/postinstall.sh
|
||||
@ -92,6 +90,7 @@ overrides:
|
||||
- perl(IO::Socket::INET6)
|
||||
- perl(JSON::XS)
|
||||
- perl(LWP::Protocol::https)
|
||||
- perl(Text::Template)
|
||||
- perl(ZMQ::Constants)
|
||||
- perl(ZMQ::LibZMQ4)
|
||||
- perl-Net-Curl
|
||||
|
@ -1,2 +1,2 @@
|
||||
# centreon_vmware command line options
|
||||
OPTIONS="--logfile=/var/log/centreon_vmware.log --severity=error"
|
||||
OPTIONS="--config-extra=/etc/centreon/centreon_vmware.json --logfile=/var/log/centreon/centreon_vmware.log --severity=info"
|
||||
|
@ -19,7 +19,8 @@
|
||||
Description=Centreon VMWare
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/perl /usr/bin/centreon_vmware.pl --logfile=/var/log/centreon/centreon_vmware.log --severity=error
|
||||
EnvironmentFile=-/etc/default/centreon_vmware
|
||||
ExecStart=/usr/bin/perl /usr/bin/centreon_vmware.pl $OPTIONS
|
||||
Type=simple
|
||||
User=centreon
|
||||
|
||||
|
@ -1,2 +1,2 @@
|
||||
# centreon_vmware command line options
|
||||
OPTIONS="--logfile=/var/log/centreon/centreon_vmware.log --severity=error"
|
||||
OPTIONS="--config-extra=/etc/centreon/centreon_vmware.json --logfile=/var/log/centreon/centreon_vmware.log --severity=info"
|
||||
|
@ -19,7 +19,8 @@
|
||||
Description=Centreon VMWare
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/bin/perl /usr/bin/centreon_vmware.pl --logfile=/var/log/centreon/centreon_vmware.log --severity=error
|
||||
EnvironmentFile=-/etc/sysconfig/centreon_vmware
|
||||
ExecStart=/usr/bin/perl /usr/bin/centreon_vmware.pl $OPTIONS
|
||||
Type=simple
|
||||
User=centreon
|
||||
|
||||
|
@ -1,7 +1,49 @@
|
||||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
if [ "$1" = "configure" ]; then # deb
|
||||
if [ ! -f "/etc/centreon/centreon_vmware.pm" ]; then
|
||||
mv /etc/centreon/centreon_vmware.pm.new /etc/centreon/centreon_vmware.pm
|
||||
fi
|
||||
json_config_file_path='/etc/centreon/centreon_vmware.json'
|
||||
perl_config_file_path='/etc/centreon/centreon_vmware.pm'
|
||||
|
||||
function migrateConfigFromPmToJson() {
|
||||
# If the legacy config file exists, we migrate it into a JSON config file
|
||||
if [[ -f "$perl_config_file_path" ]] ; then
|
||||
/usr/bin/centreon_vmware_convert_config_file "$perl_config_file_path" > "$json_config_file_path"
|
||||
mv "$perl_config_file_path" "${perl_config_file_path}.deprecated"
|
||||
fi
|
||||
chown centreon: "$json_config_file_path"
|
||||
chmod 640 "$json_config_file_path"
|
||||
}
|
||||
|
||||
function applyToSystemD() {
|
||||
systemctl daemon-reload
|
||||
systemctl restart centreon_vmware.service
|
||||
}
|
||||
|
||||
action="$1"
|
||||
version="$2"
|
||||
|
||||
if [[ "$1" == "configure" ]]; then # deb
|
||||
if [[ -z "$version" ]]; then
|
||||
# Alpine linux does not pass args, and deb passes $1=configure
|
||||
action="install"
|
||||
elif [[ -n "$version" ]]; then
|
||||
# deb passes $1=configure $2=<current version>
|
||||
action="upgrade"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
case "$action" in
|
||||
"1" | "install")
|
||||
migrateConfigFromPmToJson
|
||||
applyToSystemD
|
||||
;;
|
||||
"2" | "upgrade")
|
||||
migrateConfigFromPmToJson
|
||||
applyToSystemD
|
||||
;;
|
||||
*)
|
||||
# $1 == version being installed
|
||||
applyToSystemD
|
||||
;;
|
||||
esac
|
||||
|
||||
|
@ -54,7 +54,7 @@ BEGIN {
|
||||
|
||||
use base qw(centreon::vmware::script);
|
||||
|
||||
my $VERSION = '3.3.1';
|
||||
my $VERSION = '3.4.0';
|
||||
my %handlers = (TERM => {}, HUP => {}, CHLD => {});
|
||||
|
||||
my @load_modules = (
|
||||
@ -158,6 +158,13 @@ sub read_configuration {
|
||||
our %centreon_vmware_config;
|
||||
# loads the .pm configuration (compile time)
|
||||
require($self->{opt_extra}) or $self->{logger}->writeLogFatal("There has been an error while requiring file " . $self->{opt_extra});
|
||||
# We want all the keys to be lowercase
|
||||
for my $conf_key (keys %{$centreon_vmware_config{vsphere_server}}) {
|
||||
if ($conf_key ne lc($conf_key)) {
|
||||
$self->{logger}->writeLogDebug("The container $conf_key has capital letters. We convert it to lower case.");
|
||||
$centreon_vmware_config{vsphere_server}->{lc($conf_key)} = delete $centreon_vmware_config{vsphere_server}->{$conf_key};
|
||||
}
|
||||
}
|
||||
# Concatenation of the default parameters with the ones from the config file
|
||||
$self->{centreon_vmware_config} = {%{$self->{centreon_vmware_default_config}}, %centreon_vmware_config};
|
||||
} elsif ($self->{opt_extra} =~ /.*\.json$/i) {
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user