mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-31 01:24:35 +02:00
Compare commits
No commits in common. "develop" and "plugins-20241206" have entirely different histories.
develop
...
plugins-20
36
.github/CODEOWNERS
vendored
36
.github/CODEOWNERS
vendored
@ -1,27 +1,23 @@
|
|||||||
* @centreon/owners-connectors
|
* @centreon/owners-connectors
|
||||||
|
|
||||||
*.md @centreon/owners-doc
|
*.md @centreon/owners-doc
|
||||||
*.mdx @centreon/owners-doc
|
*.mdx @centreon/owners-doc
|
||||||
|
|
||||||
*.cmake @centreon/owners-cpp
|
*.cmake @centreon/owners-cpp
|
||||||
CMakeLists.txt @centreon/owners-cpp
|
CMakeLists.txt @centreon/owners-cpp
|
||||||
Makefile @centreon/owners-cpp
|
Makefile @centreon/owners-cpp
|
||||||
|
|
||||||
*.pm @centreon/owners-perl
|
*.pm @centreon/owners-perl
|
||||||
*.pl @centreon/owners-perl
|
*.pl @centreon/owners-perl
|
||||||
*.t @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
|
.github/** @centreon/owners-pipelines
|
||||||
packaging/** @centreon/owners-perl
|
packaging/** @centreon/owners-perl
|
||||||
selinux/** @centreon/owners-pipelines
|
selinux/** @centreon/owners-pipelines
|
||||||
.github/scripts/pod_spell_check.t @centreon/owners-perl
|
.github/scripts/pod_spell_check.t @centreon/owners-perl
|
||||||
|
|
||||||
.gitleaks.toml @centreon/owners-security
|
|
||||||
.gitleaksignore @centreon/owners-security
|
|
||||||
**/checkmarx-analysis.yml @centreon/owners-security
|
|
||||||
|
41
.github/ISSUE_TEMPLATE/1-bug-report.md
vendored
41
.github/ISSUE_TEMPLATE/1-bug-report.md
vendored
@ -1,41 +0,0 @@
|
|||||||
---
|
|
||||||
name: Bug report
|
|
||||||
about: Create a report for an issue or a bug
|
|
||||||
title: '[path::to::the::plugin]: <title>'
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Thank you for using Centreon plugins!
|
|
||||||
|
|
||||||
Please use this form for actual **bugs** only. See the **Other requests** form for more details.
|
|
||||||
All existing and future issues related to questions, new plugins or enhancements will be closed.
|
|
||||||
|
|
||||||
# Bug report
|
|
||||||
|
|
||||||
If you are certain it is a bug, please ensure that there aren't any [similar issues already open](https://github.com/centreon/centreon-plugins/issues) on the same bug.
|
|
||||||
If the same bug has already been logged, please close your issue and add a comment pointing to the existing one instead.
|
|
||||||
|
|
||||||
**For the sake of clarity, please remove the explanations from the issue template before submitting your issue.**
|
|
||||||
|
|
||||||
## Quick description
|
|
||||||
|
|
||||||
*In one or two sentences, what is your bug about?*
|
|
||||||
|
|
||||||
## How to reproduce
|
|
||||||
|
|
||||||
*Please provide the initial conditions to reproduce the bug down below*
|
|
||||||
|
|
||||||
- **Environment**: result of `uname -a ; cat /etc/redhat-release /etc/debian_version`.
|
|
||||||
- **Version of the plugin**: version of the package or last commit date if using a clone of this repository.
|
|
||||||
- **Information about the monitored resource**: the exact model and version of the device, software or product you are trying to monitor.
|
|
||||||
- **Command line**: the command line that is used.
|
|
||||||
|
|
||||||
## Expected result
|
|
||||||
|
|
||||||
*What you were expecting to have as a result (output, exit return)?*
|
|
||||||
|
|
||||||
## Actual result
|
|
||||||
|
|
||||||
*What you actually got. Please put emphasis on what seems wrong to you.*
|
|
32
.github/ISSUE_TEMPLATE/2-other-requests.md
vendored
32
.github/ISSUE_TEMPLATE/2-other-requests.md
vendored
@ -1,32 +0,0 @@
|
|||||||
---
|
|
||||||
name: Other requests
|
|
||||||
about: For other requests such as questions or enhancement requests, take a look at this form.
|
|
||||||
title: ''
|
|
||||||
labels: ''
|
|
||||||
assignees: ''
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Thank you for using Centreon plugins!
|
|
||||||
|
|
||||||
# Other requests
|
|
||||||
|
|
||||||
## Questions
|
|
||||||
|
|
||||||
If you have trouble using our plugins, but are not sure whether it's due to a bug or a misuse, please take the time to ask for help on [The Watch, Data Collection section](https://thewatch.centreon.com/data-collection-6) and become certain that it is a bug before submitting it here.
|
|
||||||
|
|
||||||
## New Plugins and modes
|
|
||||||
|
|
||||||
There is high demand for new plugins and new functionalities on existing plugins, so we have to rely on our community to help us prioritize them.
|
|
||||||
How? Post your suggestion on [The Watch Ideas](https://thewatch.centreon.com/ideas) with as much detail as possible and we will pick the most voted topics to add them to our product roadmap.
|
|
||||||
|
|
||||||
To develop a plugin/mode, we need the following information, depending on the protocol:
|
|
||||||
* **SNMP**: MIB files and full snmpwalk of enterprise branch (`snmpwalk -ObentU -v 2c -c public address .1.3.6.1.4.1 > equipment.snmpwalk`) or [SNMP collections](https://thewatch.centreon.com/product-how-to-21/snmp-collection-tutorial-132).
|
|
||||||
* **HTTP API (SOAP, Rest/Json, XML-RPC)**: the documentation and some curl examples or HTTP [collections](https://thewatch.centreon.com/data-collection-6/centreon-plugins-discover-collection-modes-131).
|
|
||||||
* **CLI**: command line examples (command + result).
|
|
||||||
* **SQL**: queries + results + column types or [SQL collections](https://thewatch.centreon.com/product-how-to-21/sql-collection-tutorial-134).
|
|
||||||
* **JMX**: mbean names and attributes.
|
|
||||||
|
|
||||||
If some information is confidential, such as logins or IP addresses, obfuscate them in what is sent publicly and we'll get in touch with you by private message if this information is needed.
|
|
||||||
|
|
||||||
Please note that all the developments are open source, we will not commit to a release date. If it is an emergency for you, please contact [Centreon's sales team](https://www.centreon.com/contact/).
|
|
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.
|
- [ ] I have provide data or shown output displaying the result of this code in the plugin area concerned.
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------------------
|
||||||
# Centreon team (internal PR)
|
# Centreon team
|
||||||
|
|
||||||
## Description
|
## Description
|
||||||
|
|
||||||
@ -75,9 +75,8 @@ 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).
|
- [ ] 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.
|
- [ ] In case of a new plugin, I have created the new packaging directory accordingly.
|
||||||
- [ ] I have implemented automated tests related to my commits.
|
- [ ] 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.
|
- [ ] I have reviewed all the help messages in all the .pm files I have modified.
|
||||||
- [ ] All sentences begin with a capital letter.
|
- [ ] All sentences begin with a capital letter.
|
||||||
- [ ] All sentences end with a period.
|
- [ ] All sentences are terminated by a period.
|
||||||
- [ ] I am able to understand all the help messages, if not, exchange with the PO or TW to rewrite them.
|
- [ ] 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.
|
- [ ] After having created the PR, I will make sure that all the tests provided in this PR have run and passed.
|
||||||
|
308
.github/actions/create-jira-ticket/action.yml
vendored
308
.github/actions/create-jira-ticket/action.yml
vendored
@ -1,308 +0,0 @@
|
|||||||
name: Workflow incident tracking
|
|
||||||
description: Create Jira ticket on incident
|
|
||||||
|
|
||||||
inputs:
|
|
||||||
jira_base_url:
|
|
||||||
required: true
|
|
||||||
description: jira base url
|
|
||||||
jira_user_email:
|
|
||||||
required: true
|
|
||||||
description: jira user email
|
|
||||||
jira_api_token:
|
|
||||||
required: true
|
|
||||||
description: jira api token
|
|
||||||
module_name:
|
|
||||||
required: true
|
|
||||||
description: module name
|
|
||||||
ticket_labels:
|
|
||||||
required: true
|
|
||||||
description: ticket labels, usually Pipeline + Nightly/Veracode + x
|
|
||||||
default: 'Pipeline'
|
|
||||||
ticket_squad:
|
|
||||||
required: true
|
|
||||||
description: id of the squad to assign the ticket to
|
|
||||||
default: 'DevSecOps'
|
|
||||||
|
|
||||||
|
|
||||||
runs:
|
|
||||||
using: "composite"
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
||||||
|
|
||||||
- name: Get ticket elements from context
|
|
||||||
id: get_context
|
|
||||||
run: |
|
|
||||||
# Safely set/unset IFS in order to properly parse the table of labels
|
|
||||||
[ -n "${IFS+set}" ] && saved_IFS=$IFS
|
|
||||||
IFS=', ' read -a ticket_labels <<< $(echo "${{ inputs.ticket_labels }}" | tr -d "[],'")
|
|
||||||
unset IFS
|
|
||||||
[ -n "${saved_IFS+set}" ] && { IFS=$saved_IFS; unset saved_IFS; }
|
|
||||||
|
|
||||||
# Change the context elements (summary, parent epic, etc.) that are checked depending on these ticket labels
|
|
||||||
if [[ "${ticket_labels[@]}" =~ "Nightly" ]]; then
|
|
||||||
parent_epic_id=206242
|
|
||||||
parent_epic_key="MON-151547"
|
|
||||||
ticket_summary="$(date '+%Y-%m-%d') ${{ inputs.module_name }}-${{ github.ref_name }} nightly build failure"
|
|
||||||
|
|
||||||
JSON_TEMPLATE_FILE="./.github/actions/create-jira-ticket/nightly-ticket-template.json"
|
|
||||||
sed -i \
|
|
||||||
-e 's|@MODULE_NAME@|${{ inputs.module_name }}|g' \
|
|
||||||
-e "s|@DATE@|$(date '+%Y-%m-%d')|g" $JSON_TEMPLATE_FILE
|
|
||||||
|
|
||||||
else
|
|
||||||
echo "::error::Cannot find a valid labelling option for the ticket."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
case "${{ inputs.ticket_squad }}" in
|
|
||||||
"DevSecOps")
|
|
||||||
ticket_squad_id=10524
|
|
||||||
ticket_board_id=184
|
|
||||||
squad_name="DEVSECOPS"
|
|
||||||
project_name="MON"
|
|
||||||
;;
|
|
||||||
"Connectors")
|
|
||||||
ticket_squad_id=10504
|
|
||||||
ticket_board_id=222
|
|
||||||
squad_name="CONNECTORS"
|
|
||||||
project_name="CTOR"
|
|
||||||
*)
|
|
||||||
echo "::error::Cannot find a valid squad for value ${{ inputs.ticket_squad }}."
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
echo "Ticket will be assigned to the $squad_name team."
|
|
||||||
|
|
||||||
current_sprint=$(curl --request GET \
|
|
||||||
--url ${{ inputs.jira_base_url }}/rest/agile/1.0/board/$ticket_board_id/sprint?state=active \
|
|
||||||
--user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
|
|
||||||
--header "Accept: application/json" | jq --arg squad_name "$squad_name" '.values[] | select(.name | test($squad_name; "i")) | .id')
|
|
||||||
|
|
||||||
echo "[DEBUG] current_sprint: $current_sprint"
|
|
||||||
|
|
||||||
# General updates on all template files
|
|
||||||
sed -i \
|
|
||||||
-e 's|@GITHUB_BRANCH@|${{ github.base_ref || github.ref_name }}|g' \
|
|
||||||
-e 's|@GITHUB_SERVER_URL@|${{ github.server_url }}|g' \
|
|
||||||
-e 's|@GITHUB_REPOSITORY@|${{ github.repository }}|g' \
|
|
||||||
-e 's|@GITHUB_RUN_ID@|${{ github.run_id }}|g' \
|
|
||||||
-e 's|@GITHUB_RUN_ATTEMPT@|${{ github.run_attempt }}|g' $JSON_TEMPLATE_FILE
|
|
||||||
|
|
||||||
echo "parent_epic_id=$parent_epic_id" >> $GITHUB_OUTPUT
|
|
||||||
echo "parent_epic_key=$parent_epic_key" >> $GITHUB_OUTPUT
|
|
||||||
echo "ticket_summary=$ticket_summary" >> $GITHUB_OUTPUT
|
|
||||||
echo "ticket_board_id=$ticket_board_id" >> $GITHUB_OUTPUT
|
|
||||||
echo "ticket_squad_id=$ticket_squad_id" >> $GITHUB_OUTPUT
|
|
||||||
echo "project_name=$project_name" >> $GITHUB_OUTPUT
|
|
||||||
echo "current_sprint=$current_sprint" >> $GITHUB_OUTPUT
|
|
||||||
echo "json_template_file=$JSON_TEMPLATE_FILE" >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
cat $JSON_TEMPLATE_FILE
|
|
||||||
cat $GITHUB_OUTPUT
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Check if the ticket already exists
|
|
||||||
id: check_ticket
|
|
||||||
run: |
|
|
||||||
# Checking if an incident ticket already exists
|
|
||||||
response=$(curl \
|
|
||||||
--write-out "%{http_code}" \
|
|
||||||
--request POST \
|
|
||||||
--url "${{ inputs.jira_base_url }}/rest/api/3/search" \
|
|
||||||
--user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
|
|
||||||
--header "Accept:application/json" \
|
|
||||||
--header "Content-Type:application/json" \
|
|
||||||
--data '{
|
|
||||||
"fields": ["summary"],
|
|
||||||
"jql": "project = ${{ steps.get_context.outputs.project_name }} AND parentEpic = ${{ steps.get_context.outputs.parent_epic_key }} AND issueType = Technical AND summary ~ \"${{ steps.get_context.outputs.ticket_summary }}\" AND component = \"${{ inputs.module_name }}\" AND resolution = unresolved ORDER BY key ASC",
|
|
||||||
"maxResults": 1
|
|
||||||
}'
|
|
||||||
)
|
|
||||||
echo "[DEBUG] $response"
|
|
||||||
|
|
||||||
if [[ $(echo "$response" | tr -d '\n' | tail -c 3) -ne 200 ]]; then
|
|
||||||
echo "::error:: Jira API request was not completed properly."
|
|
||||||
fi
|
|
||||||
|
|
||||||
ticket_key=$(echo "$response" | head -c -4 | jq .issues[0].key | xargs)
|
|
||||||
if [[ "$ticket_key" != "null" ]]; then
|
|
||||||
echo "abort_ticket_creation=true" >> $GITHUB_ENV
|
|
||||||
echo "ticket_key=$ticket_key" >> $GITHUB_ENV
|
|
||||||
echo "::notice::ticket found as $ticket_key aborting ticket creation"
|
|
||||||
fi
|
|
||||||
shell: bash
|
|
||||||
|
|
||||||
- name: Update existing nightly Jira ticket
|
|
||||||
if: |
|
|
||||||
env.abort_ticket_creation == 'true' &&
|
|
||||||
contains(steps.get_context.outputs.parent_epic_key, 'MON-151547')
|
|
||||||
run: |
|
|
||||||
# Adding failed job labels for already existing ticket
|
|
||||||
[ -n "${IFS+set}" ] && saved_IFS=$IFS
|
|
||||||
IFS=', ' read -a ticket_labels <<< $(echo "${{ inputs.ticket_labels }}" | tr -d "[],'")
|
|
||||||
unset IFS
|
|
||||||
[ -n "${saved_IFS+set}" ] && { IFS=$saved_IFS; unset saved_IFS; }
|
|
||||||
|
|
||||||
for label in ${ticket_labels[@]}; do
|
|
||||||
response=$(curl \
|
|
||||||
--request PUT \
|
|
||||||
--url "${{ inputs.jira_base_url }}/rest/api/3/issue/${{ env.ticket_key }}" \
|
|
||||||
--user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
|
|
||||||
--header 'Accept: application/json' \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data "{ \"update\": { \"labels\": [ { \"add\": \"$label\" } ] } }"
|
|
||||||
)
|
|
||||||
done
|
|
||||||
|
|
||||||
ticket_description=$(curl --request GET \
|
|
||||||
--url "${{ inputs.jira_base_url }}/rest/api/3/issue/${{ env.ticket_key }}" \
|
|
||||||
--user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
|
|
||||||
--header "Accept: application/json" | jq '.fields.description')
|
|
||||||
|
|
||||||
mapfile -t jobs_failed < <(gh run view ${{ github.run_id }} --json jobs -q '.jobs[] | select(.conclusion == "failure") | .name')
|
|
||||||
echo "[DEBUG] - jobs failed for component ${FAILED_COMPONENTS[index]}: $jobs_failed"
|
|
||||||
|
|
||||||
new_list_of_failed_jobs=$(for job in "${jobs_failed[@]}"; do
|
|
||||||
cat <<EOF
|
|
||||||
{
|
|
||||||
"type": "listItem",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "paragraph",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": "$job"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
done | jq -s '.'
|
|
||||||
)
|
|
||||||
|
|
||||||
updated_ticket_description=$(echo "$ticket_description" | jq --argjson new_list_of_failed_jobs "$new_list_of_failed_jobs" '
|
|
||||||
(.content[] | select(.type == "bulletList") | .content) = $new_list_of_failed_jobs
|
|
||||||
')
|
|
||||||
|
|
||||||
echo "[DEBUG] - updated_ticket_description = $updated_ticket_description"
|
|
||||||
|
|
||||||
curl --request PUT \
|
|
||||||
--url "${{ inputs.jira_base_url }}/rest/api/3/issue/${{ env.ticket_key }}" \
|
|
||||||
--user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
|
|
||||||
--header "Accept: application/json" \
|
|
||||||
--header "Content-Type: application/json" \
|
|
||||||
--data "{
|
|
||||||
\"fields\": {
|
|
||||||
\"description\": $updated_ticket_description
|
|
||||||
}
|
|
||||||
}"
|
|
||||||
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
||||||
|
|
||||||
- name: Create Jira Issue
|
|
||||||
if: ${{ env.abort_ticket_creation != 'true' }}
|
|
||||||
run: |
|
|
||||||
# Get the name of the current job and list it
|
|
||||||
failed_job_name=$(gh run view ${{ github.run_id }} --json jobs | jq -r --arg job_name "${{ github.job }}" '.jobs[] | select(.name == $job_name) | .name')
|
|
||||||
|
|
||||||
CONTENT_TO_ADD_TO_TEMPLATE_FILE=$(jq -n --arg job "$failed_job_name" '{
|
|
||||||
"type": "bulletList",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "listItem",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "paragraph",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": $job
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}')
|
|
||||||
|
|
||||||
echo "[DEBUG] - CONTENT_TO_ADD_TO_TEMPLATE_FILE: $CONTENT_TO_ADD_TO_TEMPLATE_FILE"
|
|
||||||
|
|
||||||
TEMPLATE_FILE=$(cat ${{ steps.get_context.outputs.json_template_file }})
|
|
||||||
UPDATED_TEMPLATE_FILE=$(jq --argjson NEW_CONTENT "$CONTENT_TO_ADD_TO_TEMPLATE_FILE" '.content += [$NEW_CONTENT]' <<< "$TEMPLATE_FILE")
|
|
||||||
|
|
||||||
# Creating a new incident ticket on Jira
|
|
||||||
DATA=$( cat <<-EOF
|
|
||||||
{
|
|
||||||
"fields": {
|
|
||||||
"summary": "${{ steps.get_context.outputs.ticket_summary }}",
|
|
||||||
"project": {"key": "${{ steps.get_context.outputs.project_name }}"},
|
|
||||||
"issuetype": {"id": "10209"},
|
|
||||||
"parent": {"id": "${{ steps.get_context.outputs.parent_epic_id }}", "key": "${{ steps.get_context.outputs.parent_epic_key }}"},
|
|
||||||
"labels": ${{ inputs.ticket_labels }},
|
|
||||||
"components":[{"name": "${{ inputs.module_name }}"}],
|
|
||||||
"customfield_10902": {"id": "${{ steps.get_context.outputs.ticket_squad_id }}", "value": "${{ inputs.ticket_squad }}"},
|
|
||||||
"description": $UPDATED_TEMPLATE_FILE
|
|
||||||
}
|
|
||||||
}
|
|
||||||
EOF
|
|
||||||
)
|
|
||||||
|
|
||||||
if [[ ${{ steps.get_context.outputs.current_sprint }} != "null" ]]; then
|
|
||||||
DATA=$(echo "$DATA" | jq '.fields.customfield_10007 = ${{ steps.get_context.outputs.current_sprint }}')
|
|
||||||
fi
|
|
||||||
echo "[DEBUG] - DATA: $DATA"
|
|
||||||
|
|
||||||
response=$(curl \
|
|
||||||
--request POST \
|
|
||||||
--url "${{ inputs.jira_base_url }}/rest/api/3/issue" \
|
|
||||||
--user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
|
|
||||||
--header 'Accept: application/json' \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data "$DATA")
|
|
||||||
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
echo "::error::Failed to create ticket: $response"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo $response
|
|
||||||
|
|
||||||
ticket_key=$(echo "$response" | jq -r .key)
|
|
||||||
echo "::notice::Created ticket: $ticket_key"
|
|
||||||
|
|
||||||
# Update priority on newly created ticket since you cannot create a ticket with another priority than medium
|
|
||||||
response=$(curl \
|
|
||||||
--request PUT \
|
|
||||||
--url "${{ inputs.jira_base_url }}/rest/api/3/issue/$ticket_key" \
|
|
||||||
--user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
|
|
||||||
--header 'Accept: application/json' \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data '{ "fields": { "priority": { "id": "1" } } }'
|
|
||||||
)
|
|
||||||
|
|
||||||
echo $response
|
|
||||||
|
|
||||||
# Update ticket status so that squad members can see it in their respective sprints
|
|
||||||
for transition_id in 11 21; do
|
|
||||||
response=$(curl \
|
|
||||||
--request POST \
|
|
||||||
--url "${{ inputs.jira_base_url }}/rest/api/latest/issue/$ticket_key/transitions" \
|
|
||||||
--user "${{ inputs.jira_user_email }}:${{ inputs.jira_api_token }}" \
|
|
||||||
--header 'Accept: application/json' \
|
|
||||||
--header 'Content-Type: application/json' \
|
|
||||||
--data "{\"transition\": {\"id\": \"$transition_id\"} }"
|
|
||||||
)
|
|
||||||
|
|
||||||
echo $response
|
|
||||||
done
|
|
||||||
|
|
||||||
shell: bash
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ github.token }}
|
|
@ -1,55 +0,0 @@
|
|||||||
{
|
|
||||||
"version": 1,
|
|
||||||
"type": "doc",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "paragraph",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": "This ticket was automatically created by the nightly workflow run. Feel free to update it as you need to. If you have any feedback about it, please contact the Delivery team.",
|
|
||||||
"marks": [
|
|
||||||
{
|
|
||||||
"type": "em"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "paragraph",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": "This incident ticket relates to the @MODULE_NAME@ nightly on the @GITHUB_BRANCH@ branch which failed on @DATE@."
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "paragraph",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": "Link to the failed nightly",
|
|
||||||
"marks": [
|
|
||||||
{
|
|
||||||
"type": "link",
|
|
||||||
"attrs": {
|
|
||||||
"href": "@GITHUB_SERVER_URL@/@GITHUB_REPOSITORY@/actions/runs/@GITHUB_RUN_ID@/attempts/@GITHUB_RUN_ATTEMPT@"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"type": "paragraph",
|
|
||||||
"content": [
|
|
||||||
{
|
|
||||||
"type": "text",
|
|
||||||
"text": "List of jobs that failed on the @MODULE_NAME@ nightly:"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
4
.github/actions/merge-artifacts/action.yml
vendored
4
.github/actions/merge-artifacts/action.yml
vendored
@ -18,14 +18,14 @@ runs:
|
|||||||
using: 'composite'
|
using: 'composite'
|
||||||
steps:
|
steps:
|
||||||
- name: Download Artifacts
|
- name: Download Artifacts
|
||||||
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
uses: actions/download-artifact@f44cd7b40bfd40b6aa1cc1b9b5b7bf03d3c67110 # v4.1.0
|
||||||
with:
|
with:
|
||||||
pattern: ${{ inputs.source_name_pattern }}*
|
pattern: ${{ inputs.source_name_pattern }}*
|
||||||
path: ${{ inputs.target_name }}
|
path: ${{ inputs.target_name }}
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Upload the Regrouped Artifact
|
- name: Upload the Regrouped Artifact
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@c7d193f32edcb7bfad88892161225aeda64e9392 # v4.0.0
|
||||||
with:
|
with:
|
||||||
name: ${{ inputs.target_name }}
|
name: ${{ inputs.target_name }}
|
||||||
path: |
|
path: |
|
||||||
|
36
.github/actions/package-delivery/action.yml
vendored
36
.github/actions/package-delivery/action.yml
vendored
@ -77,7 +77,7 @@ runs:
|
|||||||
|
|
||||||
- if: ${{ inputs.stability != 'stable' }}
|
- if: ${{ inputs.stability != 'stable' }}
|
||||||
name: Restore packages from cache
|
name: Restore packages from cache
|
||||||
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
||||||
with:
|
with:
|
||||||
path: ./*.${{ steps.parse-distrib.outputs.package_extension }}
|
path: ./*.${{ steps.parse-distrib.outputs.package_extension }}
|
||||||
key: ${{ inputs.cache_key }}
|
key: ${{ inputs.cache_key }}
|
||||||
@ -107,10 +107,11 @@ runs:
|
|||||||
}
|
}
|
||||||
|
|
||||||
- name: Download packages from testing
|
- name: Download packages from testing
|
||||||
if: ${{ inputs.stability == 'stable' && github.event_name == 'push' }}
|
if: ${{ inputs.stability == 'stable' && github.event_name == 'push' && inputs.distrib != 'jammy' }}
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
|
const warningNoPromote = 'No packages are promoted because push is not related to a hotfix/release pull request.';
|
||||||
const commitSha = context.sha;
|
const commitSha = context.sha;
|
||||||
|
|
||||||
const pulls = await github.rest.pulls.list({
|
const pulls = await github.rest.pulls.list({
|
||||||
@ -122,31 +123,25 @@ runs:
|
|||||||
per_page: 100
|
per_page: 100
|
||||||
});
|
});
|
||||||
|
|
||||||
core.startGroup(`Checking pull request linked to commit ${commitSha}`);
|
const pr = pulls.data.find(p => p.merge_commit_sha === 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) {
|
if (!pr) {
|
||||||
core.error(`No pull request found for merge commit ${commitSha}`);
|
core.warning(warningNoPromote);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const prHeadRef = pr?.head?.ref || 'unknown';
|
const prBaseRef = pr?.base?.ref || 'unknown';
|
||||||
let releaseType = '';
|
let releaseType = '';
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /^release.+/.test(prHeadRef):
|
case /^release.+/.test(prBaseRef):
|
||||||
releaseType = 'release';
|
releaseType = 'release';
|
||||||
break;
|
break;
|
||||||
case /^hotfix.+/.test(prHeadRef):
|
case /^hotfix.+/.test(prBaseRef):
|
||||||
releaseType = 'hotfix';
|
releaseType = 'hotfix';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
core.error(`No packages are promoted because push of branch ${prHeadRef} is not related to a hotfix/release pull request.`);
|
core.warning(warningNoPromote);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log(`Release type: ${releaseType}`);
|
|
||||||
|
|
||||||
let fromStabilitySubdirectory = 'testing';
|
let fromStabilitySubdirectory = 'testing';
|
||||||
if (releaseType === 'hotfix' ) {
|
if (releaseType === 'hotfix' ) {
|
||||||
@ -159,29 +154,24 @@ runs:
|
|||||||
);
|
);
|
||||||
} else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'ubuntu') {
|
} else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'ubuntu') {
|
||||||
await exec.exec(
|
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`
|
`jf rt download "ubuntu-plugins-testing/pool/${{ inputs.module_name }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb" --props "release_type=${{ inputs.release_type }}" --flat`
|
||||||
);
|
);
|
||||||
} else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'debian') {
|
} else if ('${{ steps.parse-distrib.outputs.distrib_family }}' === 'debian') {
|
||||||
await exec.exec(
|
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`
|
`jf rt download "apt-plugins-testing/pool/${{ inputs.module_name }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb" --props "release_type=${{ inputs.release_type }}" --flat`
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
- name: Publish packages to ${{ inputs.stability }}
|
- name: Publish packages to ${{ inputs.stability }}
|
||||||
if: |
|
if: |
|
||||||
contains(fromJson('["testing", "unstable"]'), inputs.stability) ||
|
contains(fromJson('["testing", "unstable"]'), inputs.stability) ||
|
||||||
(inputs.stability == 'stable' && github.event_name == 'push')
|
(inputs.stability == 'stable' && github.event_name == 'push' && inputs.distrib != 'jammy')
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
with:
|
with:
|
||||||
script: |
|
script: |
|
||||||
const path = require('path');
|
const path = require('path');
|
||||||
const globber = await glob.create('*.${{ steps.parse-distrib.outputs.package_extension }}');
|
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 }}"' : '';
|
const debTargetProps = '${{ inputs.stability }}' == 'testing' ? '--target-props "release_type=${{ inputs.release_type }}"' : '';
|
||||||
|
|
||||||
for await (const file of globber.globGenerator()) {
|
for await (const file of globber.globGenerator()) {
|
||||||
@ -193,7 +183,7 @@ runs:
|
|||||||
arch = 'x86_64';
|
arch = 'x86_64';
|
||||||
}
|
}
|
||||||
await exec.exec(
|
await exec.exec(
|
||||||
`jf rt upload "${fileName}" "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/${arch}/${stableRpmSubdirectory}${{ inputs.module_name }}/" --flat`
|
`jf rt upload "${fileName}" "${{ steps.get_repository_stability_path.outputs.repository_stability_path }}/${arch}/${{ inputs.module_name }}/" --flat`
|
||||||
);
|
);
|
||||||
} else if ('${{ steps.parse-distrib.outputs.package_extension }}' === 'deb') {
|
} else if ('${{ steps.parse-distrib.outputs.package_extension }}' === 'deb') {
|
||||||
let arch = 'all';
|
let arch = 'all';
|
||||||
|
4
.github/actions/package-nfpm/action.yml
vendored
4
.github/actions/package-nfpm/action.yml
vendored
@ -122,7 +122,7 @@ runs:
|
|||||||
done
|
done
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
||||||
with:
|
with:
|
||||||
path: ./*.${{ inputs.package_extension }}
|
path: ./*.${{ inputs.package_extension }}
|
||||||
key: ${{ inputs.cache_key }}
|
key: ${{ inputs.cache_key }}
|
||||||
@ -130,7 +130,7 @@ runs:
|
|||||||
# Add to your PR the label upload-artifacts to get packages as artifacts
|
# Add to your PR the label upload-artifacts to get packages as artifacts
|
||||||
- if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
|
- if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
|
||||||
name: Upload package artifacts
|
name: Upload package artifacts
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@26f96dfa697d77e81fd5907df203aa23a56210a8 # v4.3.0
|
||||||
with:
|
with:
|
||||||
name: packages-${{ inputs.distrib }}
|
name: packages-${{ inputs.distrib }}
|
||||||
path: ./*.${{ inputs.package_extension}}
|
path: ./*.${{ inputs.package_extension}}
|
||||||
|
5
.github/actions/parse-distrib/action.yml
vendored
5
.github/actions/parse-distrib/action.yml
vendored
@ -54,11 +54,6 @@ runs:
|
|||||||
PACKAGE_DISTRIB_NAME="0ubuntu.22.04"
|
PACKAGE_DISTRIB_NAME="0ubuntu.22.04"
|
||||||
PACKAGE_EXTENSION="deb"
|
PACKAGE_EXTENSION="deb"
|
||||||
DISTRIB_FAMILY="ubuntu"
|
DISTRIB_FAMILY="ubuntu"
|
||||||
elif [[ "${{ inputs.distrib }}" == "noble" ]]; then
|
|
||||||
PACKAGE_DISTRIB_SEPARATOR="-"
|
|
||||||
PACKAGE_DISTRIB_NAME="0ubuntu.24.04"
|
|
||||||
PACKAGE_EXTENSION="deb"
|
|
||||||
DISTRIB_FAMILY="ubuntu"
|
|
||||||
else
|
else
|
||||||
echo "::error::Distrib ${{ inputs.distrib }} cannot be parsed"
|
echo "::error::Distrib ${{ inputs.distrib }} cannot be parsed"
|
||||||
exit 1
|
exit 1
|
||||||
|
12
.github/actions/promote-to-stable/action.yml
vendored
12
.github/actions/promote-to-stable/action.yml
vendored
@ -66,21 +66,15 @@ runs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Promote DEB package to stable
|
- name: Promote DEB package to stable
|
||||||
if: ${{ contains(fromJSON('["bullseye", "bookworm", "jammy", "noble"]'), inputs.distrib) }}
|
if: ${{ contains(fromJSON('["bullseye", "bookworm"]'), inputs.distrib) }}
|
||||||
run: |
|
run: |
|
||||||
set -eux
|
set -eux
|
||||||
|
|
||||||
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
|
echo "[DEBUG] - Distrib: ${{ inputs.distrib }}"
|
||||||
echo "[DEBUG] - Distrib: ${{ inputs.module }}"
|
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."
|
echo "[DEBUG] - Get path of testing DEB packages to promote to stable."
|
||||||
SRC_PATHS=$(jf rt search --include-dirs $repo-testing/pool/${{ inputs.module }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb | jq -r '.[].path')
|
SRC_PATHS=$(jf rt search --include-dirs apt-plugins-testing/pool/${{ inputs.module }}/*${{ steps.parse-distrib.outputs.package_distrib_name }}*.deb | jq -r '.[].path')
|
||||||
|
|
||||||
if [[ ${SRC_PATHS[@]} ]]; then
|
if [[ ${SRC_PATHS[@]} ]]; then
|
||||||
for SRC_PATH in ${SRC_PATHS[@]}; do
|
for SRC_PATH in ${SRC_PATHS[@]}; do
|
||||||
@ -92,7 +86,7 @@ runs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "[DEBUG] - Build target path."
|
echo "[DEBUG] - Build target path."
|
||||||
TARGET_PATH="$repo-${{ inputs.stability }}/pool/${{ inputs.module }}/"
|
TARGET_PATH="apt-plugins-${{ inputs.stability }}/pool/${{ inputs.module }}/"
|
||||||
echo "[DEBUG] - Target path: $TARGET_PATH"
|
echo "[DEBUG] - Target path: $TARGET_PATH"
|
||||||
|
|
||||||
echo "[DEBUG] - Promoting DEB testing artifacts to stable."
|
echo "[DEBUG] - Promoting DEB testing artifacts to stable."
|
||||||
|
141
.github/actions/test-cpan-libs/action.yml
vendored
141
.github/actions/test-cpan-libs/action.yml
vendored
@ -1,141 +0,0 @@
|
|||||||
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@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
|
||||||
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:
|
steps:
|
||||||
|
|
||||||
- name: get the cached plugin
|
- name: get the cached plugin
|
||||||
uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
uses: actions/cache/restore@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0
|
||||||
with:
|
with:
|
||||||
path: ./*.${{ inputs.package-extension }}
|
path: ./*.${{ inputs.package-extension }}
|
||||||
key: ${{ inputs.cache-key }}
|
key: ${{ inputs.cache-key }}
|
||||||
@ -24,6 +24,4 @@ runs:
|
|||||||
|
|
||||||
- name: Install, test and remove plugin
|
- name: Install, test and remove plugin
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: python3 .github/scripts/test-all-plugins.py ${{ inputs.package-extension }} ${{ inputs.plugin-list }}
|
||||||
[[ -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: '/'
|
directory: '/'
|
||||||
schedule:
|
schedule:
|
||||||
interval: monthly
|
interval: monthly
|
||||||
open-pull-requests-limit: 50
|
open-pull-requests-limit: 10
|
||||||
labels:
|
labels:
|
||||||
- 'dependencies'
|
- 'dependencies'
|
||||||
- 'gha'
|
- 'gha'
|
||||||
|
@ -10,22 +10,10 @@ baseurl=https://repo.goreleaser.com/yum/
|
|||||||
enabled=1
|
enabled=1
|
||||||
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo
|
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo
|
||||||
|
|
||||||
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 -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm-2.41.0 openssl-devel jq zstd selinux-policy-devel
|
||||||
dnf config-manager --set-enabled powertools
|
|
||||||
dnf -y install perl-App-cpanminus perl-JSON
|
dnf -y install perl-App-cpanminus perl-JSON
|
||||||
cpanm App::FatPacker
|
cpanm App::FatPacker
|
||||||
cpanm File::Copy::Recursive
|
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
|
dnf clean all
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
@ -10,22 +10,10 @@ baseurl=https://repo.goreleaser.com/yum/
|
|||||||
enabled=1
|
enabled=1
|
||||||
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo
|
gpgcheck=0' | tee /etc/yum.repos.d/goreleaser.repo
|
||||||
|
|
||||||
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 -y install gcc git gettext rpm-build dos2unix python3 epel-release nfpm-2.41.0 openssl-devel jq zstd selinux-policy-devel
|
||||||
dnf config-manager --set-enabled crb
|
|
||||||
dnf -y install perl-App-cpanminus perl-JSON
|
dnf -y install perl-App-cpanminus perl-JSON
|
||||||
cpanm App::FatPacker
|
cpanm App::FatPacker
|
||||||
cpanm File::Copy::Recursive
|
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
|
dnf clean all
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
@ -55,8 +55,6 @@ apt-get install -y \
|
|||||||
|
|
||||||
cpanm Module::Build::Tiny
|
cpanm Module::Build::Tiny
|
||||||
cpanm Module::Install
|
cpanm Module::Install
|
||||||
cpanm Crypt::OpenSSL::Guess
|
|
||||||
|
|
||||||
gem install fpm
|
gem install fpm
|
||||||
|
|
||||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||||
@ -66,7 +64,3 @@ apt-get install -y nfpm=2.41.0
|
|||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
EOF
|
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,6 +38,7 @@ apt-get install -y \
|
|||||||
libapp-fatpacker-perl \
|
libapp-fatpacker-perl \
|
||||||
libcurl4-openssl-dev \
|
libcurl4-openssl-dev \
|
||||||
libczmq-dev \
|
libczmq-dev \
|
||||||
|
libczmq-dev\
|
||||||
libfile-copy-recursive-perl \
|
libfile-copy-recursive-perl \
|
||||||
libjson-perl \
|
libjson-perl \
|
||||||
libmodule-build-tiny-perl \
|
libmodule-build-tiny-perl \
|
||||||
@ -57,6 +58,7 @@ cpanm Crypt::OpenSSL::Guess
|
|||||||
|
|
||||||
gem install fpm
|
gem install fpm
|
||||||
|
|
||||||
|
|
||||||
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||||
apt-get update
|
apt-get update
|
||||||
apt-get install -y nfpm=2.41.0
|
apt-get install -y nfpm=2.41.0
|
||||||
@ -64,7 +66,3 @@ apt-get install -y nfpm=2.41.0
|
|||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
EOF
|
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
|
|
||||||
|
@ -66,7 +66,3 @@ apt-get install -y nfpm=2.41.0
|
|||||||
apt-get clean
|
apt-get clean
|
||||||
|
|
||||||
EOF
|
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,15 +6,15 @@ RUN bash -e <<EOF
|
|||||||
|
|
||||||
dnf install -y \
|
dnf install -y \
|
||||||
git \
|
git \
|
||||||
java-17-openjdk-devel \
|
|
||||||
wget \
|
wget \
|
||||||
zstd
|
zstd \
|
||||||
|
java-17-openjdk-devel
|
||||||
|
|
||||||
cd /usr/local/src
|
cd /usr/local/src
|
||||||
wget https://dlcdn.apache.org/maven/maven-3/3.8.9/binaries/apache-maven-3.8.9-bin.tar.gz
|
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.9-bin.tar.gz
|
tar zxf apache-maven-3.8.8-bin.tar.gz
|
||||||
ln -s /usr/local/src/apache-maven-3.8.9/bin/mvn /usr/bin/mvn
|
ln -s /usr/local/src/apache-maven-3.8.8/bin/mvn /usr/bin/mvn
|
||||||
rm -f apache-maven-3.8.9-bin.tar.gz
|
rm -f apache-maven-3.8.8-bin.tar.gz
|
||||||
|
|
||||||
echo '[goreleaser]
|
echo '[goreleaser]
|
||||||
name=GoReleaser
|
name=GoReleaser
|
||||||
|
@ -6,15 +6,15 @@ RUN bash -e <<EOF
|
|||||||
|
|
||||||
dnf install -y \
|
dnf install -y \
|
||||||
git \
|
git \
|
||||||
java-17-openjdk-devel \
|
|
||||||
wget \
|
wget \
|
||||||
zstd
|
zstd \
|
||||||
|
java-17-openjdk-devel
|
||||||
|
|
||||||
cd /usr/local/src
|
cd /usr/local/src
|
||||||
wget https://dlcdn.apache.org/maven/maven-3/3.8.9/binaries/apache-maven-3.8.9-bin.tar.gz
|
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.9-bin.tar.gz
|
tar zxf apache-maven-3.8.8-bin.tar.gz
|
||||||
ln -s /usr/local/src/apache-maven-3.8.9/bin/mvn /usr/bin/mvn
|
ln -s /usr/local/src/apache-maven-3.8.8/bin/mvn /usr/bin/mvn
|
||||||
rm -f apache-maven-3.8.9-bin.tar.gz
|
rm -f apache-maven-3.8.8-bin.tar.gz
|
||||||
|
|
||||||
echo '[goreleaser]
|
echo '[goreleaser]
|
||||||
name=GoReleaser
|
name=GoReleaser
|
||||||
|
@ -8,9 +8,9 @@ apt-get update
|
|||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
git \
|
git \
|
||||||
|
zstd \
|
||||||
maven=3.8.7-1 \
|
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
|
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||||
|
|
||||||
|
@ -8,9 +8,9 @@ apt-get update
|
|||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
git \
|
git \
|
||||||
|
zstd \
|
||||||
maven=3.6.3-5 \
|
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
|
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||||
|
|
||||||
|
@ -8,15 +8,15 @@ apt-get update
|
|||||||
apt-get install -y \
|
apt-get install -y \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
git \
|
git \
|
||||||
openjdk-17-jdk \
|
|
||||||
wget \
|
wget \
|
||||||
zstd
|
zstd \
|
||||||
|
openjdk-17-jdk
|
||||||
|
|
||||||
cd /usr/local/src
|
cd /usr/local/src
|
||||||
wget https://dlcdn.apache.org/maven/maven-3/3.8.9/binaries/apache-maven-3.8.9-bin.tar.gz
|
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.9-bin.tar.gz
|
tar zxf apache-maven-3.8.8-bin.tar.gz
|
||||||
ln -s /usr/local/src/apache-maven-3.8.9/bin/mvn /usr/bin/mvn
|
ln -s /usr/local/src/apache-maven-3.8.8/bin/mvn /usr/bin/mvn
|
||||||
rm -f apache-maven-3.8.9-bin.tar.gz
|
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
|
echo 'deb [trusted=yes] https://repo.goreleaser.com/apt/ /' | tee /etc/apt/sources.list.d/goreleaser.list
|
||||||
|
|
||||||
|
@ -1,30 +0,0 @@
|
|||||||
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.9/binaries/apache-maven-3.8.9-bin.tar.gz
|
|
||||||
tar zxf apache-maven-3.8.9-bin.tar.gz
|
|
||||||
ln -s /usr/local/src/apache-maven-3.8.9/bin/mvn /usr/bin/mvn
|
|
||||||
rm -f apache-maven-3.8.9-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
|
|
@ -1,72 +0,0 @@
|
|||||||
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
|
dnf install -y python3.11 python3.11-pip
|
||||||
pip3.11 install robotframework robotframework-examples
|
pip3.11 install robotframework robotframework-examples
|
||||||
# Install snmpsim
|
# Install snmpsim
|
||||||
pip3.11 install snmpsim
|
pip3.11 install snmpsim-lextudio
|
||||||
|
|
||||||
# Install node
|
# Install node
|
||||||
curl -fsSL https://rpm.nodesource.com/setup_21.x | bash -
|
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
|
dnf install -y python3.11 python3.11-pip
|
||||||
pip3.11 install robotframework robotframework-examples
|
pip3.11 install robotframework robotframework-examples
|
||||||
# Install snmpsim
|
# Install snmpsim
|
||||||
pip3.11 install snmpsim
|
pip3.11 install snmpsim-lextudio
|
||||||
|
|
||||||
# Install node
|
# Install node
|
||||||
curl -fsSL https://rpm.nodesource.com/setup_21.x | bash -
|
curl -fsSL https://rpm.nodesource.com/setup_21.x | bash -
|
||||||
|
@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
|
|||||||
|
|
||||||
FROM ${REGISTRY_URL}/debian:bookworm
|
FROM ${REGISTRY_URL}/debian:bookworm
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
# fix locale
|
# fix locale
|
||||||
RUN bash -e <<EOF
|
RUN bash -e <<EOF
|
||||||
@ -15,20 +15,16 @@ apt-get clean
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ENV LANG=en_US.utf8
|
ENV LANG en_US.utf8
|
||||||
|
|
||||||
RUN bash -e <<EOF
|
RUN bash -e <<EOF
|
||||||
|
|
||||||
# Avoid apt to clean packages cache directory
|
|
||||||
rm -f /etc/apt/apt.conf.d/docker-clean
|
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
# Install Robotframework
|
# Install Robotframework
|
||||||
apt-get install -y python3-dev python3-pip
|
apt-get install -y python3-dev python3-pip
|
||||||
rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
|
rm -rf /usr/lib/python3.11/EXTERNALLY-MANAGED
|
||||||
pip3 install robotframework robotframework-examples
|
pip3 install robotframework robotframework-examples
|
||||||
# Install snmpsim
|
# Install snmpsim
|
||||||
pip3 install snmpsim
|
pip3 install snmpsim-lextudio
|
||||||
|
|
||||||
# Install nodejs
|
# Install nodejs
|
||||||
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
||||||
|
@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
|
|||||||
|
|
||||||
FROM ${REGISTRY_URL}/debian:bullseye
|
FROM ${REGISTRY_URL}/debian:bullseye
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
# fix locale
|
# fix locale
|
||||||
RUN bash -e <<EOF
|
RUN bash -e <<EOF
|
||||||
@ -15,19 +15,15 @@ apt-get clean
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ENV LANG=en_US.utf8
|
ENV LANG en_US.utf8
|
||||||
|
|
||||||
RUN bash -e <<EOF
|
RUN bash -e <<EOF
|
||||||
|
|
||||||
# Avoid apt to clean packages cache directory
|
|
||||||
rm -f /etc/apt/apt.conf.d/docker-clean
|
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
# Install Robotframework
|
# Install Robotframework
|
||||||
apt-get install -y python3 python3-dev python3-pip
|
apt-get install -y python3 python3-dev python3-pip
|
||||||
pip3 install robotframework robotframework-examples
|
pip3 install robotframework robotframework-examples
|
||||||
# Install snmpsim
|
# Install snmpsim
|
||||||
pip3 install snmpsim
|
pip3 install snmpsim-lextudio
|
||||||
|
|
||||||
# Install nodejs
|
# Install nodejs
|
||||||
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
||||||
|
@ -2,7 +2,7 @@ ARG REGISTRY_URL=docker.io
|
|||||||
|
|
||||||
FROM ${REGISTRY_URL}/ubuntu:jammy
|
FROM ${REGISTRY_URL}/ubuntu:jammy
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
# fix locale
|
# fix locale
|
||||||
RUN bash -e <<EOF
|
RUN bash -e <<EOF
|
||||||
@ -15,19 +15,15 @@ apt-get clean
|
|||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
ENV LANG=en_US.utf8
|
ENV LANG en_US.utf8
|
||||||
|
|
||||||
RUN bash -e <<EOF
|
RUN bash -e <<EOF
|
||||||
|
|
||||||
# Avoid apt to clean packages cache directory
|
|
||||||
rm -f /etc/apt/apt.conf.d/docker-clean
|
|
||||||
|
|
||||||
apt-get update
|
apt-get update
|
||||||
# Install Robotframework
|
# Install Robotframework
|
||||||
apt-get install -y python3 python3-dev python3-pip
|
apt-get install -y python3 python3-dev python3-pip
|
||||||
pip3 install robotframework robotframework-examples
|
pip3 install robotframework robotframework-examples
|
||||||
# Install snmpsim
|
# Install snmpsim
|
||||||
pip3 install snmpsim
|
pip3 install snmpsim-lextudio
|
||||||
|
|
||||||
# Install nodejs
|
# Install nodejs
|
||||||
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
curl -fsSL https://deb.nodesource.com/setup_21.x | bash - &&\
|
||||||
|
@ -1,53 +0,0 @@
|
|||||||
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
|
|
@ -46,11 +46,11 @@ gpgcheck=1\n\
|
|||||||
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n'\
|
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n'\
|
||||||
>> /etc/yum.repos.d/centreon-plugins.repo
|
>> /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)' 'perl(String::ShellQuote)'
|
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.
|
# 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)' 'perl(Digest::MD5::File)'
|
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)' 'perl(RRDs)' 'perl(DBI)' 'perl(DBD::SQLite)' 'perl(HTTP::Daemon)' 'perl(HTTP::Daemon::SSL)' 'perl(NetAddr::IP)' 'perl(Mojolicious)' 'perl(Mojo::IOLoop::Signal)' 'perl(Net::Curl)' 'perl(EV)'
|
dnf -y install 'perl(Hash::Merge)' 'perl(YAML::XS)' 'perl(ZMQ::FFI)' 'perl-CryptX' 'perl(EV)'
|
||||||
dnf -y install git mariadb
|
|
||||||
dnf clean all
|
dnf clean all
|
||||||
mkdir -p /var/lib/centreon/centplugins/
|
mkdir -p /var/lib/centreon/centplugins/
|
||||||
chmod 777 /var/lib/centreon/centplugins/
|
chmod 777 /var/lib/centreon/centplugins/
|
||||||
|
@ -45,14 +45,10 @@ enabled=1\n\
|
|||||||
gpgcheck=1\n\
|
gpgcheck=1\n\
|
||||||
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n'\
|
gpgkey=https://yum-gpg.centreon.com/RPM-GPG-KEY-CES\n'\
|
||||||
>> /etc/yum.repos.d/centreon-plugins.repo
|
>> /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)' 'perl(String::ShellQuote)'
|
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.
|
# 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)' 'perl(Digest::MD5::File)'
|
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(ZMQ::FFI)' 'perl(EV)' 'perl(RRDs)' 'perl(DBI)' 'perl(DBD::SQLite)' 'perl(HTTP::Daemon)' 'perl(HTTP::Daemon::SSL)' 'perl(NetAddr::IP)' 'perl(Mojolicious)' 'perl(Mojo::IOLoop::Signal)' 'perl(Net::Curl)'
|
dnf -y install 'perl(Hash::Merge)' 'perl(YAML::XS)' 'perl(ZMQ::FFI)' 'perl-CryptX' 'perl(EV)'
|
||||||
dnf -y install git mariadb
|
|
||||||
dnf clean all
|
|
||||||
|
|
||||||
dnf clean all
|
dnf clean all
|
||||||
mkdir -p /var/lib/centreon/centplugins/
|
mkdir -p /var/lib/centreon/centplugins/
|
||||||
chmod 777 /var/lib/centreon/centplugins/
|
chmod 777 /var/lib/centreon/centplugins/
|
||||||
|
@ -23,11 +23,10 @@ echo "deb https://packages.centreon.com/apt-plugins-testing/ bookworm main" | te
|
|||||||
echo "deb https://packages.centreon.com/apt-plugins-unstable/ bookworm main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
|
echo "deb https://packages.centreon.com/apt-plugins-unstable/ bookworm 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
|
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 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 libstring-shellquote-perl
|
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.
|
# 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 librrds-perl libdbi-perl libdbd-sqlite3-perl libhttp-daemon-perl libhttp-daemon-ssl-perl libnetaddr-ip-perl libmojolicious-perl libmojo-ioloop-signal-perl libnet-curl-perl libev-perl
|
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 libdigest-md5-file-perl
|
apt-get -y install libhash-merge-perl libyaml-libyaml-perl libzmq-ffi-perl libcryptx-perl libev-perl
|
||||||
apt-get -y install git mariadb-client
|
|
||||||
apt-get clean
|
apt-get clean
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
@ -23,10 +23,10 @@ echo "deb https://packages.centreon.com/apt-plugins-testing/ bullseye main" | te
|
|||||||
echo "deb https://packages.centreon.com/apt-plugins-unstable/ bullseye main" | tee -a /etc/apt/sources.list.d/centreon-plugins.list
|
echo "deb https://packages.centreon.com/apt-plugins-unstable/ bullseye 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
|
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 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 libdigest-md5-file-perl libstring-shellquote-perl
|
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.
|
# this image is used by centreon-perl-libs unit test and centreon-gorgone unit tests.
|
||||||
apt-get -y install libzmq-ffi-perl libcpanel-json-xs-perl libcrypt-openssl-aes-perl libnet-curl-perl libyaml-libyaml-perl libhash-merge-perl libclone-choose-perl libcryptx-perl libjson-xs-perl libjson-pp-perl librrds-perl libdbi-perl libdbd-sqlite3-perl libhttp-daemon-perl libhttp-daemon-ssl-perl libnetaddr-ip-perl libmojolicious-perl libmojo-ioloop-signal-perl libnet-curl-perl libev-perl libdigest-md5-file-perl
|
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 git mariadb-client
|
apt-get -y install libhash-merge-perl libyaml-libyaml-perl libzmq-ffi-perl libcryptx-perl libev-perl libcpanel-json-xs-perl
|
||||||
apt-get clean
|
apt-get clean
|
||||||
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness UUID
|
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness UUID
|
||||||
EOF
|
EOF
|
||||||
|
@ -25,10 +25,9 @@ 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
|
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 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 libstring-shellquote-perl
|
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.
|
# 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 librrds-perl libdbi-perl libdbd-sqlite3-perl libhttp-daemon-perl libhttp-daemon-ssl-perl libnetaddr-ip-perl libmojolicious-perl libmojo-ioloop-signal-perl libnet-curl-perl libev-perl libdigest-md5-file-perl
|
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 git mariadb-client
|
|
||||||
apt-get clean
|
apt-get clean
|
||||||
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness UUID
|
NONINTERACTIVE_TESTING=1 PERL_MM_USE_DEFAULT=1 cpan Test2::Harness UUID
|
||||||
|
|
||||||
|
@ -1,38 +0,0 @@
|
|||||||
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 libstring-shellquote-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 librrds-perl libdbi-perl libdbd-sqlite3-perl libhttp-daemon-perl libhttp-daemon-ssl-perl libnetaddr-ip-perl libmojolicious-perl libmojo-ioloop-signal-perl libnet-curl-perl libev-perl libdigest-md5-file-perl
|
|
||||||
apt-get -y install git mariadb-client
|
|
||||||
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
|
|
@ -53,7 +53,6 @@ overrides:
|
|||||||
perl(FindBin),
|
perl(FindBin),
|
||||||
perl(lib),
|
perl(lib),
|
||||||
perl(sort),
|
perl(sort),
|
||||||
perl(String::ShellQuote),
|
|
||||||
@RPM_DEPENDENCIES@
|
@RPM_DEPENDENCIES@
|
||||||
]
|
]
|
||||||
conflicts:
|
conflicts:
|
||||||
@ -81,7 +80,6 @@ overrides:
|
|||||||
libkeepass-reader-perl,
|
libkeepass-reader-perl,
|
||||||
libdatetime-perl,
|
libdatetime-perl,
|
||||||
libxml-libxml-perl,
|
libxml-libxml-perl,
|
||||||
libstring-shellquote-perl,
|
|
||||||
@DEB_DEPENDENCIES@
|
@DEB_DEPENDENCIES@
|
||||||
]
|
]
|
||||||
conflicts:
|
conflicts:
|
||||||
|
1
.github/scripts/plugins-source.container.pl
vendored
1
.github/scripts/plugins-source.container.pl
vendored
@ -66,7 +66,6 @@ foreach my $plugin (@plugins) {
|
|||||||
File::Path::remove_tree('lib');
|
File::Path::remove_tree('lib');
|
||||||
File::Path::make_path('lib');
|
File::Path::make_path('lib');
|
||||||
my @common_files = (
|
my @common_files = (
|
||||||
'centreon/plugins/curllogger.pm',
|
|
||||||
'centreon/plugins/http.pm',
|
'centreon/plugins/http.pm',
|
||||||
'centreon/plugins/misc.pm',
|
'centreon/plugins/misc.pm',
|
||||||
'centreon/plugins/mode.pm',
|
'centreon/plugins/mode.pm',
|
||||||
|
59
.github/scripts/pod_spell_check.t
vendored
59
.github/scripts/pod_spell_check.t
vendored
@ -1,62 +1,23 @@
|
|||||||
use strict;
|
use strict;
|
||||||
use warnings;
|
use warnings;
|
||||||
use Test::Spelling;
|
|
||||||
use List::MoreUtils qw(uniq);
|
|
||||||
|
|
||||||
# the command must have at least one argument
|
use Test::More;
|
||||||
|
use Test::Spelling;
|
||||||
|
|
||||||
if (!@ARGV) {
|
if (!@ARGV) {
|
||||||
die "Usage: perl pod_spell_check.t module.pm stopwords.t";
|
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';
|
my $stopword_filename='tests/resources/spellcheck/stopwords.txt';
|
||||||
if(defined($ARGV[1])){
|
if(defined($ARGV[1])){
|
||||||
$stopword_filename=$ARGV[1];
|
$stopword_filename=$ARGV[1];
|
||||||
}
|
}
|
||||||
|
open(FILE, "<", $stopword_filename)
|
||||||
|
or die "Could not open $stopword_filename";
|
||||||
|
printf("Using dictionary: ".$stopword_filename." \n");
|
||||||
|
|
||||||
# get_stopwords(): reads the text file and returns its content as an array or strings
|
add_stopwords(<FILE>);
|
||||||
sub get_stopwords {
|
close(FILE);
|
||||||
my ($file) = @_;
|
set_spell_cmd('hunspell -l');
|
||||||
|
all_pod_files_spelling_ok($ARGV[0]);
|
||||||
|
|
||||||
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);
|
|
||||||
|
40
.github/scripts/test-all-plugins.py
vendored
40
.github/scripts/test-all-plugins.py
vendored
@ -10,8 +10,8 @@ def get_tests_folders(plugin_name):
|
|||||||
folder_list = []
|
folder_list = []
|
||||||
pkg_file = open("./packaging/" + plugin_name + "/pkg.json")
|
pkg_file = open("./packaging/" + plugin_name + "/pkg.json")
|
||||||
packaging = json.load(pkg_file)
|
packaging = json.load(pkg_file)
|
||||||
for file in packaging["files"]: # loop on "files" array in pkg.json file.
|
for file in packaging["files"]: # loop on "files" array in pkg.json file.
|
||||||
if os.path.isdir("tests/" + file): # check if the path is a directory in the "tests" folder
|
if os.path.isdir("tests/" + file): # check if the path is a directory in the "tests" folder
|
||||||
folder_list.append("tests/" + file)
|
folder_list.append("tests/" + file)
|
||||||
return folder_list
|
return folder_list
|
||||||
|
|
||||||
@ -27,10 +27,8 @@ def test_plugin(plugin_name):
|
|||||||
print(f"{plugin_name} folders_list : {folders_list}")
|
print(f"{plugin_name} folders_list : {folders_list}")
|
||||||
if len(folders_list) == 0:
|
if len(folders_list) == 0:
|
||||||
return 0 # no tests present at the moment, but we still have tested the plugin can be installed.
|
return 0 # no tests present at the moment, but we still have tested the plugin can be installed.
|
||||||
robot_results = subprocess.run(
|
robot_results = subprocess.run("robot --exclude notauto -v ''CENTREON_PLUGINS:" + get_plugin_full_path(plugin_name) + " " + " ".join(folders_list),
|
||||||
"robot --exclude notauto -v ''CENTREON_PLUGINS:" + get_plugin_full_path(plugin_name) + " " + " ".join(
|
shell=True, check=False)
|
||||||
folders_list),
|
|
||||||
shell=True, check=False)
|
|
||||||
return robot_results.returncode
|
return robot_results.returncode
|
||||||
|
|
||||||
|
|
||||||
@ -54,13 +52,12 @@ def launch_snmp_sim():
|
|||||||
snmpsim_cmd = "snmpsim-command-responder --logging-method=null --agent-udpv4-endpoint=127.0.0.1:2024 --process-user=snmp --process-group=snmp --data-dir='./tests' &"
|
snmpsim_cmd = "snmpsim-command-responder --logging-method=null --agent-udpv4-endpoint=127.0.0.1:2024 --process-user=snmp --process-group=snmp --data-dir='./tests' &"
|
||||||
try_command(cmd=snmpsim_cmd, error="can't launch snmp sim daemon.")
|
try_command(cmd=snmpsim_cmd, error="can't launch snmp sim daemon.")
|
||||||
|
|
||||||
|
|
||||||
def refresh_packet_manager(archi):
|
def refresh_packet_manager(archi):
|
||||||
with open('/var/log/robot-plugins-installation-tests.log', "a") as outfile:
|
with open('/var/log/robot-plugins-installation-tests.log', "a") as outfile:
|
||||||
if archi == "deb":
|
if archi == "deb":
|
||||||
outfile.write("apt-get update\n")
|
outfile.write("apt-get update\n")
|
||||||
output_status = (subprocess.run(
|
output_status = (subprocess.run(
|
||||||
"apt-get update",
|
"apt-get update",
|
||||||
shell=True, check=False, stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
shell=True, check=False, stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
||||||
elif archi == "rpm":
|
elif archi == "rpm":
|
||||||
return 0
|
return 0
|
||||||
@ -69,20 +66,17 @@ def refresh_packet_manager(archi):
|
|||||||
exit(1)
|
exit(1)
|
||||||
return output_status
|
return output_status
|
||||||
|
|
||||||
|
|
||||||
def install_plugin(plugin, archi):
|
def install_plugin(plugin, archi):
|
||||||
with open('/var/log/robot-plugins-installation-tests.log', "a") as outfile:
|
with open('/var/log/robot-plugins-installation-tests.log', "a") as outfile:
|
||||||
if archi == "deb":
|
if archi == "deb":
|
||||||
outfile.write(
|
outfile.write("apt-get install -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' -y ./" + plugin.lower() + "*.deb\n")
|
||||||
"apt-get install -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' -y ./" + plugin.lower() + "*.deb\n")
|
|
||||||
output_status = (subprocess.run(
|
output_status = (subprocess.run(
|
||||||
"apt-get install -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' -y ./" + plugin.lower() + "*.deb",
|
"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
|
shell=True, check=False, stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
||||||
elif archi == "rpm":
|
elif archi == "rpm":
|
||||||
outfile.write("dnf install --setopt=keepcache=True -y ./" + plugin + "*.rpm\n")
|
outfile.write("dnf install -y ./" + plugin + "*.rpm\n")
|
||||||
output_status = (
|
output_status = (subprocess.run("dnf install -y ./" + plugin + "*.rpm", shell=True, check=False,
|
||||||
subprocess.run("dnf install --setopt=keepcache=True -y ./" + plugin + "*.rpm", shell=True, check=False,
|
stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
||||||
stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
|
||||||
else:
|
else:
|
||||||
print(f"Unknown architecture, expected deb or rpm, got {archi}. Exiting.")
|
print(f"Unknown architecture, expected deb or rpm, got {archi}. Exiting.")
|
||||||
exit(1)
|
exit(1)
|
||||||
@ -92,19 +86,17 @@ def install_plugin(plugin, archi):
|
|||||||
def remove_plugin(plugin, archi):
|
def remove_plugin(plugin, archi):
|
||||||
with open('/var/log/robot-plugins-installation-tests.log', "a") as outfile:
|
with open('/var/log/robot-plugins-installation-tests.log', "a") as outfile:
|
||||||
if archi == "deb":
|
if archi == "deb":
|
||||||
outfile.write(
|
outfile.write("apt-get -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' autoremove -y " + plugin.lower() + "\n")
|
||||||
"export SUDO_FORCE_REMOVE=yes; apt-get -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' autoremove -y "
|
|
||||||
+ plugin.lower() + "\n")
|
|
||||||
output_status = (subprocess.run(
|
output_status = (subprocess.run(
|
||||||
"export SUDO_FORCE_REMOVE=yes; apt-get -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' autoremove -y " + plugin.lower(),
|
"apt-get -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' autoremove -y " + plugin.lower(),
|
||||||
shell=True, check=False, stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
shell=True, check=False, stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
||||||
# -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' is an option to force apt to keep the package in
|
# -o 'Binary::apt::APT::Keep-Downloaded-Packages=1;' is an option to force apt to keep the package in
|
||||||
# /var/cache/apt/archives, so it do not re download them for every installation.
|
# /var/cache/apt/archives, so it do not re download them for every installation.
|
||||||
# 'autoremove', contrary to 'remove' all dependancy while removing the original package.
|
# 'autoremove', contrary to 'remove' all dependancy while removing the original package.
|
||||||
|
|
||||||
elif archi == "rpm":
|
elif archi == "rpm":
|
||||||
outfile.write("dnf remove --setopt=protected_packages= --setopt=keepcache=True -y " + plugin + "\n")
|
outfile.write("dnf remove -y " + plugin + "\n")
|
||||||
output_status = (subprocess.run("dnf remove --setopt=protected_packages= --setopt=keepcache=True -y " + plugin, shell=True, check=False,
|
output_status = (subprocess.run("dnf remove -y " + plugin, shell=True, check=False,
|
||||||
stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
stderr=subprocess.STDOUT, stdout=outfile)).returncode
|
||||||
else:
|
else:
|
||||||
print(f"Unknown architecture, expected deb or rpm, got {archi}. Exiting.")
|
print(f"Unknown architecture, expected deb or rpm, got {archi}. Exiting.")
|
||||||
@ -143,7 +135,7 @@ if __name__ == '__main__':
|
|||||||
print("plugin : ", plugin)
|
print("plugin : ", plugin)
|
||||||
folders_list = get_tests_folders(plugin)
|
folders_list = get_tests_folders(plugin)
|
||||||
if len(folders_list) == 0:
|
if len(folders_list) == 0:
|
||||||
print(f"we don't test {plugin} as it doesn't have any robot tests.")
|
print(f"we don't test {plugin} as it don't have any robots tests.")
|
||||||
continue
|
continue
|
||||||
|
|
||||||
nb_plugins += 1
|
nb_plugins += 1
|
||||||
@ -161,7 +153,7 @@ if __name__ == '__main__':
|
|||||||
error_purge += tmp
|
error_purge += tmp
|
||||||
|
|
||||||
print(f"{nb_plugins} plugins tested.\n there was {error_install} installation error, {error_tests} test "
|
print(f"{nb_plugins} plugins tested.\n there was {error_install} installation error, {error_tests} test "
|
||||||
f"errors, and {error_purge} removal error list of error : {list_plugin_error}", )
|
f"errors, and {error_purge} removal error list of error : {list_plugin_error}",)
|
||||||
|
|
||||||
if error_install != 0 or error_tests != 0 or error_purge != 0:
|
if error_install != 0 or error_tests != 0 or error_purge != 0:
|
||||||
exit(1)
|
exit(1)
|
||||||
|
7
.github/workflows/actionlint.yml
vendored
7
.github/workflows/actionlint.yml
vendored
@ -29,17 +29,14 @@ jobs:
|
|||||||
- name: Check workflow files
|
- name: Check workflow files
|
||||||
run: |
|
run: |
|
||||||
${{ steps.get_actionlint.outputs.executable }} \
|
${{ steps.get_actionlint.outputs.executable }} \
|
||||||
-ignore 'label "centreon-common" is unknown' \
|
-ignore 'label "common" is unknown' \
|
||||||
-ignore 'label "centreon-collect-arm64" is unknown' \
|
-ignore 'label "veracode" is unknown' \
|
||||||
-ignore '"github.head_ref" is potentially untrusted' \
|
-ignore '"github.head_ref" is potentially untrusted' \
|
||||||
-shellcheck= \
|
-shellcheck= \
|
||||||
-pyflakes= \
|
-pyflakes= \
|
||||||
-color
|
-color
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Ensure SHA pinned actions
|
|
||||||
uses: centreon/github-actions-ensure-sha-pinned-actions@47d553c67ceb08ad660deaeb3b994e47a3dd8fc3 # v3.0.23.3
|
|
||||||
|
|
||||||
yaml-lint:
|
yaml-lint:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
steps:
|
steps:
|
||||||
|
23
.github/workflows/as400.yml
vendored
23
.github/workflows/as400.yml
vendored
@ -20,13 +20,10 @@ jobs:
|
|||||||
get-environment:
|
get-environment:
|
||||||
uses: ./.github/workflows/get-environment.yml
|
uses: ./.github/workflows/get-environment.yml
|
||||||
with:
|
with:
|
||||||
version_file: as400/connector.as400/pom.xml
|
version_file: as400/packaging/centreon-as400-daemon.yaml
|
||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -47,9 +44,7 @@ jobs:
|
|||||||
- package_extension: deb
|
- package_extension: deb
|
||||||
image: packaging-plugins-java-jammy
|
image: packaging-plugins-java-jammy
|
||||||
distrib: jammy
|
distrib: jammy
|
||||||
- package_extension: deb
|
|
||||||
image: packaging-plugins-java-noble
|
|
||||||
distrib: noble
|
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||||
@ -104,7 +99,7 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
|
|
||||||
- name: Save to cache
|
- name: Save to cache
|
||||||
uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.${{ matrix.package_extension }}
|
path: ./*.${{ matrix.package_extension }}
|
||||||
key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
|
||||||
@ -112,7 +107,6 @@ jobs:
|
|||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, package]
|
needs: [get-environment, package]
|
||||||
if: |
|
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')) &&
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||||
! cancelled() &&
|
! cancelled() &&
|
||||||
! contains(needs.*.result, 'failure') &&
|
! contains(needs.*.result, 'failure') &&
|
||||||
@ -132,8 +126,6 @@ jobs:
|
|||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: jammy
|
- distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
name: deliver ${{ matrix.distrib }}
|
name: deliver ${{ matrix.distrib }}
|
||||||
steps:
|
steps:
|
||||||
@ -149,12 +141,3 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
180
.github/workflows/check-status.yml
vendored
@ -1,180 +0,0 @@
|
|||||||
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"]') , 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"]') , 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);
|
|
68
.github/workflows/checkmarx-analysis.yml
vendored
68
.github/workflows/checkmarx-analysis.yml
vendored
@ -1,68 +0,0 @@
|
|||||||
name: Checkmarx scans
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
inputs:
|
|
||||||
module_name:
|
|
||||||
required: true
|
|
||||||
type: string
|
|
||||||
module_directory:
|
|
||||||
required: false
|
|
||||||
type: string
|
|
||||||
|
|
||||||
secrets:
|
|
||||||
base_uri:
|
|
||||||
required: true
|
|
||||||
cx_tenant:
|
|
||||||
required: true
|
|
||||||
cx_client_id:
|
|
||||||
required: true
|
|
||||||
cx_client_secret:
|
|
||||||
required: true
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
pipeline-scan:
|
|
||||||
name: Run a pipeline scan
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- name: routing
|
|
||||||
run: |
|
|
||||||
# Quality gate settings
|
|
||||||
ENABLE_QG="true"
|
|
||||||
if [[ "${{ vars.CHECKMARX_QUALITY_GATE }}" != "yes" ]]; then
|
|
||||||
# disabling all QG in case of incident with the service
|
|
||||||
ENABLE_QG="false"
|
|
||||||
echo "Skipping analysis. Caused by QG override"
|
|
||||||
elif [[ "${{ github.event_name }}" == "pull_request" && "${{ github.event.pull_request.user.id }}" == "49699333" ]]; then
|
|
||||||
# disabling the QG in case of pull request opened by dependabot bot
|
|
||||||
# As dependabot will not be able to access GH secrets
|
|
||||||
ENABLE_QG="false"
|
|
||||||
echo "Skipping analysis. Caused by dependabot PR"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Check forced full scan
|
|
||||||
SCAN_MODE="--sast-incremental"
|
|
||||||
if [[ "${{ github.event_name }}" == "schedule" || "${{ vars.CHECKMARX_FORCE_FULL_SCAN }}" == "yes" ]]; then
|
|
||||||
SCAN_MODE="--sast-incremental=false"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "scan_mode=$SCAN_MODE" >> $GITHUB_ENV
|
|
||||||
echo "enable_analysis=$ENABLE_QG" >> $GITHUB_ENV
|
|
||||||
cat $GITHUB_ENV
|
|
||||||
|
|
||||||
- name: Checkout
|
|
||||||
if: env.enable_analysis == 'true'
|
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
||||||
|
|
||||||
- name: Checkmarx One CLI Action
|
|
||||||
if: env.enable_analysis == 'true'
|
|
||||||
uses: checkmarx/ast-github-action@88c60148b7b9689d67eb05bf66a65bbb871f2f2c # v2.3.20
|
|
||||||
with:
|
|
||||||
project_name: ${{ inputs.module_name }}
|
|
||||||
base_uri: ${{ secrets.base_uri }}
|
|
||||||
cx_tenant: ${{ secrets.cx_tenant }}
|
|
||||||
cx_client_id: ${{ secrets.cx_client_id }}
|
|
||||||
cx_client_secret: ${{ secrets.cx_client_secret }}
|
|
||||||
source_dir: "./"
|
|
||||||
additional_params: --scan-types "sast,sca,api-security" ${{ env.scan_mode }}
|
|
21
.github/workflows/connector-vmware.yml
vendored
21
.github/workflows/connector-vmware.yml
vendored
@ -26,9 +26,7 @@ jobs:
|
|||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -48,9 +46,6 @@ jobs:
|
|||||||
- package_extension: deb
|
- package_extension: deb
|
||||||
image: packaging-plugins-jammy
|
image: packaging-plugins-jammy
|
||||||
distrib: jammy
|
distrib: jammy
|
||||||
- package_extension: deb
|
|
||||||
image: packaging-plugins-noble
|
|
||||||
distrib: noble
|
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||||
@ -80,7 +75,7 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
- name: Upload apt/dnf packages as artifacts if asked
|
- name: Upload apt/dnf packages as artifacts if asked
|
||||||
if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
|
if: ${{ contains(github.event.pull_request.labels.*.name, 'upload-artifacts') }}
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@0b2256b8c012f0828dc542b3febcab082c67f72b # v4.3.4
|
||||||
with:
|
with:
|
||||||
name: vmware-connector-daemon-${{ matrix.distrib }}
|
name: vmware-connector-daemon-${{ matrix.distrib }}
|
||||||
path: centreon-plugin*
|
path: centreon-plugin*
|
||||||
@ -89,7 +84,6 @@ jobs:
|
|||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, package]
|
needs: [get-environment, package]
|
||||||
if: |
|
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')) &&
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||||
! cancelled() &&
|
! cancelled() &&
|
||||||
! contains(needs.*.result, 'failure') &&
|
! contains(needs.*.result, 'failure') &&
|
||||||
@ -109,8 +103,6 @@ jobs:
|
|||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: jammy
|
- distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
name: deliver ${{ matrix.distrib }}
|
name: deliver ${{ matrix.distrib }}
|
||||||
steps:
|
steps:
|
||||||
@ -126,12 +118,3 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
|
|
||||||
|
@ -18,14 +18,7 @@ on:
|
|||||||
- ".github/docker/packaging/*"
|
- ".github/docker/packaging/*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-environment:
|
create-and-push-docker:
|
||||||
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:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -45,7 +38,7 @@ jobs:
|
|||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
dockerfile: packaging-plugins-bullseye
|
dockerfile: packaging-plugins-bullseye
|
||||||
image: packaging-plugins-bullseye
|
image: packaging-plugins-bullseye
|
||||||
- runner: centreon-collect-arm64
|
- runner: ["self-hosted", "collect-arm64"]
|
||||||
dockerfile: packaging-plugins-bullseye
|
dockerfile: packaging-plugins-bullseye
|
||||||
image: packaging-plugins-bullseye-arm64
|
image: packaging-plugins-bullseye-arm64
|
||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
@ -63,12 +56,6 @@ jobs:
|
|||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
dockerfile: packaging-plugins-java-jammy
|
dockerfile: packaging-plugins-java-jammy
|
||||||
image: 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 }}
|
runs-on: ${{ matrix.runner }}
|
||||||
|
|
||||||
@ -77,22 +64,22 @@ jobs:
|
|||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- name: Login to Registry
|
- name: Login to Registry
|
||||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
|
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
|
||||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||||
|
|
||||||
- name: Login to proxy registry
|
- name: Login to proxy registry
|
||||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
|
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
|
||||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||||
|
|
||||||
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
|
||||||
|
|
||||||
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
- uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
|
||||||
with:
|
with:
|
||||||
file: .github/docker/packaging/Dockerfile.${{ matrix.dockerfile }}
|
file: .github/docker/packaging/Dockerfile.${{ matrix.dockerfile }}
|
||||||
context: .
|
context: .
|
||||||
@ -100,12 +87,3 @@ jobs:
|
|||||||
pull: true
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
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,40 +18,29 @@ on:
|
|||||||
- ".github/docker/testing/*"
|
- ".github/docker/testing/*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-environment:
|
create-and-push-docker:
|
||||||
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:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- runner: ubuntu-24.04
|
- runner: ubuntu-22.04
|
||||||
dockerfile: alma8
|
dockerfile: alma8
|
||||||
image: alma8
|
image: alma8
|
||||||
- runner: ubuntu-24.04
|
- runner: ubuntu-22.04
|
||||||
dockerfile: alma9
|
dockerfile: alma9
|
||||||
image: alma9
|
image: alma9
|
||||||
- runner: ubuntu-24.04
|
- runner: ubuntu-22.04
|
||||||
dockerfile: bullseye
|
dockerfile: bullseye
|
||||||
image: bullseye
|
image: bullseye
|
||||||
- runner: centreon-collect-arm64
|
- runner: ["self-hosted", "collect-arm64"]
|
||||||
dockerfile: bullseye
|
dockerfile: bullseye
|
||||||
image: bullseye-arm64
|
image: bullseye-arm64
|
||||||
- runner: ubuntu-24.04
|
- runner: ubuntu-22.04
|
||||||
dockerfile: bookworm
|
dockerfile: bookworm
|
||||||
image: bookworm
|
image: bookworm
|
||||||
- runner: ubuntu-24.04
|
- runner: ubuntu-22.04
|
||||||
dockerfile: jammy
|
dockerfile: jammy
|
||||||
image: jammy
|
image: jammy
|
||||||
- runner: ubuntu-24.04
|
|
||||||
dockerfile: noble
|
|
||||||
image: noble
|
|
||||||
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
|
|
||||||
@ -60,22 +49,22 @@ jobs:
|
|||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- name: Login to Registry
|
- name: Login to Registry
|
||||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
|
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
|
||||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||||
|
|
||||||
- name: Login to proxy registry
|
- name: Login to proxy registry
|
||||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
|
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
|
||||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||||
|
|
||||||
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
|
||||||
|
|
||||||
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
- uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
|
||||||
with:
|
with:
|
||||||
file: .github/docker/testing/Dockerfile.testing-plugins-${{ matrix.dockerfile }}
|
file: .github/docker/testing/Dockerfile.testing-plugins-${{ matrix.dockerfile }}
|
||||||
context: .
|
context: .
|
||||||
@ -83,12 +72,3 @@ jobs:
|
|||||||
pull: true
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/testing-plugins-${{ matrix.image }}:latest
|
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
|
|
||||||
|
31
.github/workflows/docker-builder-unit-tests.yml
vendored
31
.github/workflows/docker-builder-unit-tests.yml
vendored
@ -18,14 +18,7 @@ on:
|
|||||||
- ".github/docker/unit-tests/*"
|
- ".github/docker/unit-tests/*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
get-environment:
|
create-and-push-docker:
|
||||||
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:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@ -39,7 +32,7 @@ jobs:
|
|||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
dockerfile: bullseye
|
dockerfile: bullseye
|
||||||
image: bullseye
|
image: bullseye
|
||||||
- runner: centreon-collect-arm64
|
- runner: ["self-hosted", "collect-arm64"]
|
||||||
dockerfile: bullseye
|
dockerfile: bullseye
|
||||||
image: bullseye-arm64
|
image: bullseye-arm64
|
||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
@ -48,9 +41,6 @@ jobs:
|
|||||||
- runner: ubuntu-22.04
|
- runner: ubuntu-22.04
|
||||||
dockerfile: jammy
|
dockerfile: jammy
|
||||||
image: jammy
|
image: jammy
|
||||||
- runner: ubuntu-22.04
|
|
||||||
dockerfile: noble
|
|
||||||
image: noble
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
|
|
||||||
@ -59,22 +49,22 @@ jobs:
|
|||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- name: Login to Registry
|
- name: Login to Registry
|
||||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
|
registry: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}
|
||||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||||
|
|
||||||
- name: Login to proxy registry
|
- name: Login to proxy registry
|
||||||
uses: docker/login-action@74a5d142397b4f367a81961eba4e8cd7edddf772 # v3.4.0
|
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0
|
||||||
with:
|
with:
|
||||||
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
|
registry: ${{ vars.DOCKER_PROXY_REGISTRY_URL }}
|
||||||
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
username: ${{ secrets.HARBOR_CENTREON_PUSH_USERNAME }}
|
||||||
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
password: ${{ secrets.HARBOR_CENTREON_PUSH_TOKEN }}
|
||||||
|
|
||||||
- uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1
|
- uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db # v3.6.1
|
||||||
|
|
||||||
- uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
|
- uses: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
|
||||||
with:
|
with:
|
||||||
file: .github/docker/unit-tests/Dockerfile.unit-tests-${{ matrix.dockerfile }}
|
file: .github/docker/unit-tests/Dockerfile.unit-tests-${{ matrix.dockerfile }}
|
||||||
context: .
|
context: .
|
||||||
@ -82,12 +72,3 @@ jobs:
|
|||||||
pull: true
|
pull: true
|
||||||
push: true
|
push: true
|
||||||
tags: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/unit-tests-${{ matrix.image }}:latest
|
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
|
|
||||||
|
23
.github/workflows/generic-plugins.yml
vendored
23
.github/workflows/generic-plugins.yml
vendored
@ -1,23 +0,0 @@
|
|||||||
name: Generic Plugins
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
pull_request:
|
|
||||||
paths:
|
|
||||||
- 'experimental/**'
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
- master
|
|
||||||
paths:
|
|
||||||
- 'experimental/**'
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
get-environment:
|
|
||||||
uses: ./.github/workflows/get-environment.yml
|
|
||||||
with:
|
|
||||||
version_file: experimental/Cargo.toml
|
|
249
.github/workflows/get-environment.yml
vendored
249
.github/workflows/get-environment.yml
vendored
@ -4,9 +4,6 @@ on:
|
|||||||
version_file:
|
version_file:
|
||||||
required: false
|
required: false
|
||||||
type: string
|
type: string
|
||||||
nightly_manual_trigger:
|
|
||||||
required: false
|
|
||||||
type: boolean
|
|
||||||
outputs:
|
outputs:
|
||||||
version:
|
version:
|
||||||
description: "version"
|
description: "version"
|
||||||
@ -20,21 +17,12 @@ on:
|
|||||||
target_stability:
|
target_stability:
|
||||||
description: "Final target branch stability (stable, testing, unstable, canary or not defined if not a pull request)"
|
description: "Final target branch stability (stable, testing, unstable, canary or not defined if not a pull request)"
|
||||||
value: ${{ jobs.get-environment.outputs.target_stability }}
|
value: ${{ jobs.get-environment.outputs.target_stability }}
|
||||||
is_nightly:
|
|
||||||
description: "if the current workflow run is considered a nightly"
|
|
||||||
value: ${{ jobs.get-environment.outputs.is_nightly }}
|
|
||||||
release_type:
|
release_type:
|
||||||
description: "type of release (hotfix, release or not defined if not a release)"
|
description: "type of release (hotfix, release or not defined if not a release)"
|
||||||
value: ${{ jobs.get-environment.outputs.release_type }}
|
value: ${{ jobs.get-environment.outputs.release_type }}
|
||||||
is_targeting_feature_branch:
|
is_targeting_feature_branch:
|
||||||
description: "if it is a PR, check if targeting a feature branch"
|
description: "if it is a PR, check if targeting a feature branch"
|
||||||
value: ${{ jobs.get-environment.outputs.is_targeting_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:
|
jobs:
|
||||||
get-environment:
|
get-environment:
|
||||||
@ -46,136 +34,10 @@ jobs:
|
|||||||
target_stability: ${{ steps.get_stability.outputs.target_stability }}
|
target_stability: ${{ steps.get_stability.outputs.target_stability }}
|
||||||
release_type: ${{ steps.get_release_type.outputs.release_type }}
|
release_type: ${{ steps.get_release_type.outputs.release_type }}
|
||||||
is_targeting_feature_branch: ${{ steps.get_stability.outputs.is_targeting_feature_branch }}
|
is_targeting_feature_branch: ${{ steps.get_stability.outputs.is_targeting_feature_branch }}
|
||||||
is_nightly: ${{ steps.get_nightly_status.outputs.is_nightly }}
|
|
||||||
skip_workflow: ${{ steps.skip_workflow.outputs.result }}
|
|
||||||
labels: ${{ steps.has_skip_label.outputs.labels }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- 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 = [];
|
|
||||||
|
|
||||||
if (${{ contains(fromJSON('["pull_request"]') , 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)
|
- name: Checkout sources (current branch)
|
||||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
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@ed68ef82c095e0d48ec87eccea555d944a631a4c # v46.0.5
|
|
||||||
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' }}
|
- if: ${{ github.event_name == 'pull_request' }}
|
||||||
name: Get nested pull request path
|
name: Get nested pull request path
|
||||||
@ -212,7 +74,7 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
const getStability = (branchName) => {
|
const getStability = (branchName) => {
|
||||||
switch (true) {
|
switch (true) {
|
||||||
case /(^develop$)|(^dev-\d{2}\.\d{2}\.x$)/.test(branchName):
|
case /(^develop$)|(^dev-\d{2}\.\d{2}\.x$)|(^prepare-release-cloud.*)/.test(branchName):
|
||||||
return 'unstable';
|
return 'unstable';
|
||||||
case /(^release.+)|(^hotfix.+)/.test(branchName):
|
case /(^release.+)|(^hotfix.+)/.test(branchName):
|
||||||
return 'testing';
|
return 'testing';
|
||||||
@ -251,102 +113,26 @@ jobs:
|
|||||||
|
|
||||||
core.setOutput('is_targeting_feature_branch', isTargetingFeatureBranch);
|
core.setOutput('is_targeting_feature_branch', isTargetingFeatureBranch);
|
||||||
|
|
||||||
- name: Detect nightly status
|
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
|
||||||
id: get_nightly_status
|
|
||||||
env:
|
|
||||||
NIGHTLY_MANUAL_TRIGGER: ${{ inputs.nightly_manual_trigger }}
|
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const getNightlyInput = () => {
|
|
||||||
const nightly_manual_trigger = process.env.NIGHTLY_MANUAL_TRIGGER;
|
|
||||||
console.log(nightly_manual_trigger);
|
|
||||||
if (typeof nightly_manual_trigger === 'undefined' || nightly_manual_trigger === '' || '${{ github.repository }}'.match(/^workflow-.*$/)) {
|
|
||||||
return 'false';
|
|
||||||
} else if (context.eventName === 'schedule' || context.eventName === 'workflow_dispatch' && nightly_manual_trigger === 'true' ) {
|
|
||||||
return 'true';
|
|
||||||
}
|
|
||||||
return 'false';
|
|
||||||
};
|
|
||||||
|
|
||||||
core.setOutput('is_nightly', getNightlyInput());
|
|
||||||
|
|
||||||
- name: Get version
|
- name: Get version
|
||||||
id: get_version
|
id: get_version
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
run: |
|
||||||
with:
|
if [[ "${{ inputs.version_file }}" == "" ]]; then
|
||||||
script: |
|
VERSION=$(date '+%Y%m%d')
|
||||||
const { execSync } = require('child_process');
|
elif [[ "${{ inputs.version_file }}" == */*.yaml ]]; then
|
||||||
const fs = require('fs');
|
VERSION=$(grep 'version: ' ${{ inputs.version_file }} | cut -d' ' -f2 | tr -d '"')
|
||||||
let version = '';
|
else
|
||||||
if ('${{ inputs.version_file }}'.match(/pom\.xml$/)) {
|
VERSION=$(grep VERSION ${{ inputs.version_file }} | cut -d "'" -f 2)
|
||||||
version = execSync(`grep -m 1 "<version>.*</version>" ${{ inputs.version_file }} | sed 's/.*<version>\\(.*\\)<\\/version>.*/\\1/'`).toString().trim();
|
fi
|
||||||
|
echo "version=$(echo $VERSION)" >> $GITHUB_OUTPUT
|
||||||
|
shell: bash
|
||||||
|
|
||||||
} else if ('${{ steps.get_stability.outputs.stability }}' === 'stable') {
|
- name: "Get release: 1 for testing / stable, <date>.<commit_sha> for others"
|
||||||
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
|
id: get_release
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
run: |
|
||||||
with:
|
RELEASE=$(date '+%H%M%S')
|
||||||
script: |
|
|
||||||
let release = '';
|
|
||||||
|
|
||||||
if (${{ contains(fromJSON('["testing", "unstable"]') , steps.get_stability.outputs.stability) }} === true) {
|
echo "release=$RELEASE" >> $GITHUB_OUTPUT
|
||||||
release = "1"
|
shell: bash
|
||||||
} else {
|
|
||||||
release = Date.now()
|
|
||||||
}
|
|
||||||
|
|
||||||
core.setOutput('release', release);
|
|
||||||
|
|
||||||
- name: "Get release type: hotfix, release or not defined if not a release"
|
- name: "Get release type: hotfix, release or not defined if not a release"
|
||||||
id: get_release_type
|
id: get_release_type
|
||||||
@ -369,9 +155,6 @@ jobs:
|
|||||||
['release_type', '${{ steps.get_release_type.outputs.release_type || '<em>not defined because this is not a release</em>' }}'],
|
['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 }}'],
|
['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>' }}'],
|
['target_stability', '${{ steps.get_stability.outputs.target_stability || '<em>not defined because current run is not triggered by pull request event</em>' }}'],
|
||||||
['is_nightly', '${{ steps.get_nightly_status.outputs.is_nightly }}'],
|
|
||||||
['skip_workflow', '${{ steps.skip_workflow.outputs.result }}'],
|
|
||||||
['labels', '${{ steps.has_skip_label.outputs.labels }}'],
|
|
||||||
];
|
];
|
||||||
core.summary
|
core.summary
|
||||||
.addHeading(`${context.workflow} environment outputs`)
|
.addHeading(`${context.workflow} environment outputs`)
|
||||||
|
26
.github/workflows/gitleaks.yml
vendored
26
.github/workflows/gitleaks.yml
vendored
@ -1,26 +0,0 @@
|
|||||||
name: gitleaks
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
scan:
|
|
||||||
name: gitleaks
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- uses: gitleaks/gitleaks-action@ff98106e4c7b2bc287b24eaf42907196329070c7 # v2.3.9
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
GITLEAKS_LICENSE: Centreon
|
|
||||||
GITLEAKS_ENABLE_COMMENTS: false
|
|
||||||
GITLEAKS_ENABLE_UPLOAD_ARTIFACT: false
|
|
||||||
GITLEAKS_ENABLE_SUMMARY: false
|
|
19
.github/workflows/nrpe.yml
vendored
19
.github/workflows/nrpe.yml
vendored
@ -24,9 +24,6 @@ jobs:
|
|||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -47,9 +44,6 @@ jobs:
|
|||||||
- package_extension: deb
|
- package_extension: deb
|
||||||
image: packaging-plugins-jammy
|
image: packaging-plugins-jammy
|
||||||
distrib: jammy
|
distrib: jammy
|
||||||
- package_extension: deb
|
|
||||||
image: packaging-plugins-noble
|
|
||||||
distrib: noble
|
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||||
@ -123,7 +117,6 @@ jobs:
|
|||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, package]
|
needs: [get-environment, package]
|
||||||
if: |
|
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')) &&
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||||
! cancelled() &&
|
! cancelled() &&
|
||||||
! contains(needs.*.result, 'failure') &&
|
! contains(needs.*.result, 'failure') &&
|
||||||
@ -143,9 +136,6 @@ jobs:
|
|||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: jammy
|
- distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
|
|
||||||
name: deliver ${{ matrix.distrib }}
|
name: deliver ${{ matrix.distrib }}
|
||||||
steps:
|
steps:
|
||||||
@ -161,12 +151,3 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
|
|
||||||
|
453
.github/workflows/perl-cpan-libraries.yml
vendored
453
.github/workflows/perl-cpan-libraries.yml
vendored
@ -24,9 +24,7 @@ jobs:
|
|||||||
|
|
||||||
package-rpm:
|
package-rpm:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
|
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
strategy:
|
strategy:
|
||||||
@ -43,7 +41,6 @@ jobs:
|
|||||||
"Config::AWS",
|
"Config::AWS",
|
||||||
"Convert::Binary::C",
|
"Convert::Binary::C",
|
||||||
"Convert::EBCDIC",
|
"Convert::EBCDIC",
|
||||||
"Crypt::Argon2",
|
|
||||||
"Crypt::Blowfish_PP",
|
"Crypt::Blowfish_PP",
|
||||||
"Crypt::OpenSSL::AES",
|
"Crypt::OpenSSL::AES",
|
||||||
"DataStruct::Flat",
|
"DataStruct::Flat",
|
||||||
@ -53,20 +50,15 @@ jobs:
|
|||||||
"Device::Modbus::RTU::Client",
|
"Device::Modbus::RTU::Client",
|
||||||
"Device::Modbus::TCP::Client",
|
"Device::Modbus::TCP::Client",
|
||||||
"Email::Send::SMTP::Gmail",
|
"Email::Send::SMTP::Gmail",
|
||||||
"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::CheckLib",
|
||||||
"FFI::Platypus",
|
"FFI::Platypus",
|
||||||
"File::SearchPath",
|
"File::SearchPath",
|
||||||
"HTTP::ProxyPAC",
|
"HTTP::ProxyPAC",
|
||||||
"JMX::Jmx4Perl",
|
"JMX::Jmx4Perl",
|
||||||
"JSON::Path",
|
|
||||||
"Libssh::Session",
|
|
||||||
"LV",
|
|
||||||
"Mojo::IOLoop::Signal",
|
"Mojo::IOLoop::Signal",
|
||||||
"MongoDB",
|
"MongoDB",
|
||||||
"MooseX::ClassAttribute",
|
"MooseX::ClassAttribute",
|
||||||
"Net::Amazon::Signature::V4",
|
"Net::Amazon::Signature::V4",
|
||||||
"Net::Curl",
|
|
||||||
"Net::DHCP",
|
"Net::DHCP",
|
||||||
"Net::FTPSSL",
|
"Net::FTPSSL",
|
||||||
"Net::HTTPTunnel",
|
"Net::HTTPTunnel",
|
||||||
@ -98,9 +90,6 @@ jobs:
|
|||||||
- rpm_provides: ""
|
- rpm_provides: ""
|
||||||
- version: ""
|
- version: ""
|
||||||
- spec_file: ""
|
- spec_file: ""
|
||||||
- no-auto-depends: "false"
|
|
||||||
- preinstall_cpanlibs: ""
|
|
||||||
- revision: "1"
|
|
||||||
- distrib: el8
|
- distrib: el8
|
||||||
package_extension: rpm
|
package_extension: rpm
|
||||||
image: packaging-plugins-alma8
|
image: packaging-plugins-alma8
|
||||||
@ -109,10 +98,6 @@ jobs:
|
|||||||
image: packaging-plugins-alma9
|
image: packaging-plugins-alma9
|
||||||
- name: "BSON"
|
- 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)"
|
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"
|
- name: "DateTime::Format::Duration::ISO8601"
|
||||||
rpm_provides: "perl(DateTime-Format-Duration-ISO8601)"
|
rpm_provides: "perl(DateTime-Format-Duration-ISO8601)"
|
||||||
- name: "Device::Modbus::RTU::Client"
|
- name: "Device::Modbus::RTU::Client"
|
||||||
@ -124,19 +109,7 @@ jobs:
|
|||||||
- name: "FFI::Platypus"
|
- name: "FFI::Platypus"
|
||||||
rpm_provides: "perl(FFI::Platypus::Buffer) perl(FFI::Platypus::Memory)"
|
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)"
|
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"
|
- name: "Net::DHCP"
|
||||||
rpm_provides: "perl(Net::DHCP::Constants) perl(Net::DHCP::Packet)"
|
rpm_provides: "perl(Net::DHCP::Constants) perl(Net::DHCP::Packet)"
|
||||||
- name: "Net::SMTPS"
|
- name: "Net::SMTPS"
|
||||||
@ -156,6 +129,11 @@ jobs:
|
|||||||
- name: "ZMQ::LibZMQ4"
|
- name: "ZMQ::LibZMQ4"
|
||||||
version: "0.01"
|
version: "0.01"
|
||||||
rpm_dependencies: "zeromq"
|
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 }}
|
name: package ${{ matrix.distrib }} ${{ matrix.name }}
|
||||||
container:
|
container:
|
||||||
@ -166,51 +144,44 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||||
name: Get package infos
|
|
||||||
id: package-infos
|
|
||||||
run: |
|
run: |
|
||||||
cpan_info=$(cpanm --info ${{ matrix.name }})
|
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: |
|
||||||
if [ -z "${{ matrix.version }}" ]; then
|
if [ -z "${{ matrix.version }}" ]; then
|
||||||
CPAN_PACKAGE_VERSION=$(echo $cpan_info | sed 's/\.tar\.gz$//' | sed 's/.*\-//')
|
PACKAGE_VERSION=""
|
||||||
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
|
else
|
||||||
PACKAGE_VERSION="${{ matrix.version }}"
|
PACKAGE_VERSION=" -v ${{ matrix.version }}"
|
||||||
fi
|
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
|
if [ -z "${{ matrix.rpm_dependencies }}" ]; then
|
||||||
PACKAGE_DEPENDENCIES=""
|
PACKAGE_DEPENDENCIES=""
|
||||||
@ -220,7 +191,7 @@ jobs:
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "${{ matrix.no-auto-depends }}" == "true" ]; then
|
if [ ! -z "${{ matrix.no-auto-depends }}" ]; then
|
||||||
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --no-auto-depends"
|
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --no-auto-depends"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -232,25 +203,15 @@ jobs:
|
|||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for CPANLIB_PREINSTALL in `echo "${{ matrix.preinstall_cpanlibs }}"`; do
|
cpanm Module::Build::Tiny
|
||||||
cpanm $CPANLIB_PREINSTALL
|
cpanm Module::Install
|
||||||
done
|
|
||||||
|
|
||||||
export SYBASE="/usr"
|
export SYBASE="/usr"
|
||||||
|
|
||||||
temp_file=$(mktemp)
|
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 }}
|
||||||
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
|
shell: bash
|
||||||
|
|
||||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file != '' }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.spec_file != '' }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
|
||||||
|
|
||||||
@ -259,7 +220,7 @@ jobs:
|
|||||||
cp -r ~/rpmbuild/RPMS/noarch/*.rpm .
|
cp -r ~/rpmbuild/RPMS/noarch/*.rpm .
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||||
name: Replace '::' with - in the feature path
|
name: Replace '::' with - in the feature path
|
||||||
id: package-name
|
id: package-name
|
||||||
run: |
|
run: |
|
||||||
@ -269,18 +230,15 @@ jobs:
|
|||||||
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT
|
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_distribs, matrix.distrib) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
with:
|
with:
|
||||||
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash }}
|
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ steps.package-name.outputs.name_with_dash }}
|
||||||
path: ./*.${{ matrix.package_extension }}
|
path: ./*.${{ matrix.package_extension }}
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
merge-package-rpm-artifacts:
|
merge-package-rpm-artifacts:
|
||||||
needs: [get-environment, package-rpm]
|
needs: [package-rpm]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -288,7 +246,7 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Merge Artifacts
|
- name: Merge Artifacts
|
||||||
uses: actions/upload-artifact/merge@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact/merge@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
with:
|
with:
|
||||||
name: packages-rpm-${{ matrix.distrib }}
|
name: packages-rpm-${{ matrix.distrib }}
|
||||||
pattern: packages-rpm-${{ matrix.distrib }}-*
|
pattern: packages-rpm-${{ matrix.distrib }}-*
|
||||||
@ -302,10 +260,7 @@ jobs:
|
|||||||
failOnError: false
|
failOnError: false
|
||||||
|
|
||||||
sign-rpm:
|
sign-rpm:
|
||||||
needs: [get-environment, merge-package-rpm-artifacts]
|
needs: [merge-package-rpm-artifacts]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
|
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
strategy:
|
strategy:
|
||||||
@ -323,9 +278,9 @@ jobs:
|
|||||||
- run: apt-get install -y zstd
|
- run: apt-get install -y zstd
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||||
with:
|
with:
|
||||||
name: packages-rpm-${{ matrix.distrib }}
|
name: packages-rpm-${{ matrix.distrib }}
|
||||||
path: ./
|
path: ./
|
||||||
@ -336,138 +291,86 @@ jobs:
|
|||||||
- run: rpmsign --addsign ./*.rpm
|
- run: rpmsign --addsign ./*.rpm
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.rpm
|
path: ./*.rpm
|
||||||
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||||
|
|
||||||
package-deb:
|
package-deb:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner_name }}
|
runs-on: ${{ matrix.runner_name }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [packaging-plugins-bullseye, packaging-plugins-bookworm, packaging-plugins-jammy, packaging-plugins-noble, packaging-plugins-bullseye-arm64]
|
image: [packaging-plugins-bullseye, packaging-plugins-bookworm, packaging-plugins-jammy, packaging-plugins-bullseye-arm64]
|
||||||
name:
|
name:
|
||||||
[
|
[
|
||||||
"ARGV::Struct",
|
"ARGV::Struct",
|
||||||
|
"Authen::SCRAM::Client",
|
||||||
"Config::AWS",
|
"Config::AWS",
|
||||||
"Convert::EBCDIC",
|
"Convert::EBCDIC",
|
||||||
"Crypt::Argon2",
|
|
||||||
"Crypt::Blowfish_PP",
|
"Crypt::Blowfish_PP",
|
||||||
"Crypt::OpenSSL::AES",
|
"Crypt::OpenSSL::AES",
|
||||||
"DataStruct::Flat",
|
"DataStruct::Flat",
|
||||||
"DateTime::Format::Duration::ISO8601",
|
"DateTime::Format::Duration::ISO8601",
|
||||||
"Device::Modbus",
|
"Device::Modbus",
|
||||||
"Device::Modbus::RTU::Client",
|
|
||||||
"Device::Modbus::TCP::Client",
|
|
||||||
"Digest::SHA1",
|
"Digest::SHA1",
|
||||||
"Email::Send::SMTP::Gmail",
|
"Email::Send::SMTP::Gmail",
|
||||||
"Hash::Ordered",
|
"Hash::Ordered",
|
||||||
"HTTP::ProxyPAC",
|
"HTTP::ProxyPAC",
|
||||||
"JMX::Jmx4Perl",
|
"JMX::Jmx4Perl",
|
||||||
"Libssh::Session",
|
|
||||||
"Mojo::IOLoop::Signal",
|
"Mojo::IOLoop::Signal",
|
||||||
"Net::Amazon::Signature::V4",
|
"Net::Amazon::Signature::V4",
|
||||||
"Net::Curl",
|
|
||||||
"Net::FTPSSL",
|
"Net::FTPSSL",
|
||||||
"Net::HTTPTunnel",
|
"Net::HTTPTunnel",
|
||||||
"Net::MQTT::Simple",
|
"Net::MQTT::Simple",
|
||||||
|
"Net::SMTP_auth",
|
||||||
"Paws",
|
"Paws",
|
||||||
"Statistics::Regression",
|
"Statistics::Regression",
|
||||||
"XS::Loader",
|
"WWW::Selenium",
|
||||||
"ZMQ::Constants",
|
"ZMQ::Constants",
|
||||||
"ZMQ::LibZMQ4"
|
"ZMQ::LibZMQ4"
|
||||||
]
|
]
|
||||||
include:
|
include:
|
||||||
- runner_name: ubuntu-24.04
|
- runner_name: ubuntu-24.04
|
||||||
- arch: amd64
|
- arch: amd64
|
||||||
- build_names: "bullseye-amd64,bookworm,jammy,noble"
|
- build_distribs: "bullseye,bookworm,jammy"
|
||||||
- deb_dependencies: ""
|
- deb_dependencies: ""
|
||||||
- deb_provides: ""
|
- rpm_provides: ""
|
||||||
- version: ""
|
- version: ""
|
||||||
- use_dh_make_perl: "true"
|
- use_dh_make_perl: "true"
|
||||||
- no-auto-depends: "false"
|
- spec_file: ""
|
||||||
- preinstall_cpanlibs: ""
|
- distrib: bullseye
|
||||||
- revision: "1"
|
|
||||||
- build_name: bullseye-amd64
|
|
||||||
distrib: bullseye
|
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
image: packaging-plugins-bullseye
|
image: packaging-plugins-bullseye
|
||||||
- build_name: bookworm
|
- distrib: bookworm
|
||||||
distrib: bookworm
|
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
image: packaging-plugins-bookworm
|
image: packaging-plugins-bookworm
|
||||||
- build_name: jammy
|
- distrib: jammy
|
||||||
distrib: jammy
|
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
image: packaging-plugins-jammy
|
image: packaging-plugins-jammy
|
||||||
- build_name: noble
|
- distrib: bullseye
|
||||||
distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
image: packaging-plugins-noble
|
|
||||||
- build_name: bullseye-arm64
|
|
||||||
distrib: bullseye
|
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
image: packaging-plugins-bullseye-arm64
|
image: packaging-plugins-bullseye-arm64
|
||||||
arch: arm64
|
arch: arm64
|
||||||
runner_name: centreon-collect-arm64
|
runner_name: ["self-hosted", "collect-arm64"]
|
||||||
- name: "Crypt::Argon2"
|
|
||||||
build_names: "bullseye-amd64,jammy,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,noble"
|
|
||||||
- name: "Device::Modbus::TCP::Client"
|
|
||||||
build_names: "bookworm,noble"
|
|
||||||
- name: "Digest::SHA1"
|
|
||||||
build_names: "jammy,noble"
|
|
||||||
- name: "Hash::Ordered"
|
|
||||||
build_names: "bullseye-amd64,bookworm,jammy"
|
|
||||||
- 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"
|
- name: "Net::Amazon::Signature::V4"
|
||||||
build_names: "bullseye-amd64,jammy"
|
build_distribs: ["bullseye", "jammy"]
|
||||||
- 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"
|
- name: "Net::MQTT::Simple"
|
||||||
version: "1.29"
|
version: "1.29"
|
||||||
build_names: "bullseye-amd64,bookworm,jammy"
|
|
||||||
- name: "Paws"
|
- name: "Paws"
|
||||||
use_dh_make_perl: "false"
|
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"
|
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"
|
- name: "Statistics::Regression"
|
||||||
build_names: "bullseye-amd64"
|
build_distribs: "bullseye"
|
||||||
version: "0.53"
|
version: "0.53"
|
||||||
- name: "ZMQ::LibZMQ4"
|
- name: "ZMQ::LibZMQ4"
|
||||||
use_dh_make_perl: "false"
|
use_dh_make_perl: "false"
|
||||||
version: "0.01"
|
version: "0.01"
|
||||||
deb_dependencies: "libzmq5"
|
deb_dependencies: "libzmq5"
|
||||||
build_names: "bullseye-amd64,bookworm,jammy,noble,bullseye-arm64"
|
|
||||||
name: package ${{ matrix.distrib }} ${{ matrix.arch }} ${{ matrix.name }}
|
name: package ${{ matrix.distrib }} ${{ matrix.arch }} ${{ matrix.name }}
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||||
@ -476,73 +379,43 @@ jobs:
|
|||||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- if: ${{ contains(matrix.build_names, matrix.build_name) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||||
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- if: ${{ contains(matrix.build_names, matrix.build_name) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||||
name: Parse distrib name
|
name: Parse distrib name
|
||||||
id: parse-distrib
|
id: parse-distrib
|
||||||
uses: ./.github/actions/parse-distrib
|
uses: ./.github/actions/parse-distrib
|
||||||
with:
|
with:
|
||||||
distrib: ${{ matrix.distrib }}
|
distrib: ${{ matrix.distrib }}
|
||||||
|
|
||||||
- if: ${{ contains(matrix.build_names, matrix.build_name) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||||
name: Get package infos
|
name: Get package version
|
||||||
id: package-infos
|
id: package-version
|
||||||
run: |
|
run: |
|
||||||
apt-get update
|
apt-get update
|
||||||
cpan_info=$(cpanm --info ${{ matrix.name }})
|
apt-get install -y cpanminus
|
||||||
|
|
||||||
if [ -z "${{ matrix.version }}" ]; then
|
if [ -z "${{ matrix.version }}" ]; then
|
||||||
CPAN_PACKAGE_VERSION=$(echo $cpan_info | sed 's/\.tar\.gz$//' | sed 's/.*\-//')
|
CPAN_PACKAGE_VERSION=$(cpanm --info ${{ matrix.name }} | sed 's/\.tar\.gz$//' | sed 's/.*\-//' | sed 's/v//')
|
||||||
if [[ ! $CPAN_PACKAGE_VERSION =~ ^[v0-9]+\.[0-9]+ ]]; then
|
|
||||||
|
if [[ ! $CPAN_PACKAGE_VERSION =~ ^[0-9]+\.[0-9]+ ]]; then
|
||||||
echo "::error::Invalid version number: ${CPAN_PACKAGE_VERSION}"
|
echo "::error::Invalid version number: ${CPAN_PACKAGE_VERSION}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PACKAGE_VERSION="${CPAN_PACKAGE_VERSION}"
|
PACKAGE_VERSION="${CPAN_PACKAGE_VERSION}"
|
||||||
else
|
else
|
||||||
PACKAGE_VERSION="${{ matrix.version }}"
|
PACKAGE_VERSION="${{ matrix.version }}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "package_version=$(echo $PACKAGE_VERSION)" >> $GITHUB_OUTPUT
|
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
|
shell: bash
|
||||||
|
|
||||||
- if: ${{ contains(matrix.build_names, matrix.build_name) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'false' }}
|
||||||
name: Check if package already exists
|
|
||||||
id: check-package-existence
|
|
||||||
run: |
|
run: |
|
||||||
package_info=$(apt-cache policy ${{ steps.package-infos.outputs.package_name }})
|
apt-get install -y ruby libcurl4-openssl-dev libssh-dev uuid-dev libczmq-dev
|
||||||
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
|
if [ -z "${{ matrix.deb_dependencies }}" ]; then
|
||||||
PACKAGE_DEPENDENCIES=""
|
PACKAGE_DEPENDENCIES=""
|
||||||
else
|
else
|
||||||
@ -550,57 +423,30 @@ jobs:
|
|||||||
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends $PACKAGE_DEPENDENCY"
|
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --depends $PACKAGE_DEPENDENCY"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if [ "${{ matrix.no-auto-depends }}" == "true" ]; then
|
|
||||||
|
if [ ! -z "${{ matrix.no-auto-depends }}" ]; then
|
||||||
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --no-auto-depends"
|
PACKAGE_DEPENDENCIES="$PACKAGE_DEPENDENCIES --no-auto-depends"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "${{ matrix.deb_provides }}" ]; then
|
cpanm Module::Build::Tiny
|
||||||
PACKAGE_PROVIDES=""
|
cpanm Module::Install
|
||||||
else
|
|
||||||
for PACKAGE_PROVIDE in `echo "${{ matrix.deb_provides }}"`; do
|
|
||||||
PACKAGE_PROVIDES="$PACKAGE_PROVIDES --provides $PACKAGE_PROVIDE"
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
temp_file=$(mktemp)
|
gem install fpm
|
||||||
echo "default.local" | tee /etc/mailname
|
# 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")
|
||||||
# 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
|
shell: bash
|
||||||
|
|
||||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_names, matrix.build_name) && matrix.use_dh_make_perl == 'true' }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) && matrix.use_dh_make_perl == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
# Install needed cpan libs
|
apt-get install -y libcurl4-openssl-dev dh-make-perl libssh-dev uuid-dev libczmq-dev libmodule-install-perl libmodule-build-tiny-perl
|
||||||
for CPANLIB_PREINSTALL in `echo "${{ matrix.preinstall_cpanlibs }}"`; do
|
# module-build-tiny is required for Mojo::IOLoop::Signal build.
|
||||||
cpanm $CPANLIB_PREINSTALL
|
|
||||||
done
|
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 }}
|
||||||
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
|
shell: bash
|
||||||
|
|
||||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_names, matrix.build_name) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||||
name: Replace '::' with - in the feature path
|
name: Replace '::' with - in the feature path
|
||||||
id: package-name
|
id: package-name
|
||||||
run: |
|
run: |
|
||||||
@ -610,26 +456,23 @@ jobs:
|
|||||||
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT
|
echo "name_with_dash=$name_with_dash" >> $GITHUB_OUTPUT
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- if: ${{ steps.check-package-existence.outputs.do_not_build == 'false' && contains(matrix.build_names, matrix.build_name) }}
|
- if: ${{ contains(matrix.build_distribs, matrix.distrib) }}
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
with:
|
with:
|
||||||
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ matrix.arch }}-${{ steps.package-name.outputs.name_with_dash}}
|
name: packages-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ matrix.arch }}-${{ steps.package-name.outputs.name_with_dash}}
|
||||||
path: ./*.${{ matrix.package_extension }}
|
path: ./*.${{ matrix.package_extension }}
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
merge-package-deb-artifacts:
|
merge-package-deb-artifacts:
|
||||||
needs: [get-environment, package-deb]
|
needs: [package-deb]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
distrib: [bullseye, bookworm, jammy, noble]
|
distrib: [bullseye, bookworm, jammy]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Merge Artifacts
|
- name: Merge Artifacts
|
||||||
uses: actions/upload-artifact/merge@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact/merge@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
with:
|
with:
|
||||||
name: packages-deb-${{ matrix.distrib }}
|
name: packages-deb-${{ matrix.distrib }}
|
||||||
pattern: packages-deb-${{ matrix.distrib }}-*
|
pattern: packages-deb-${{ matrix.distrib }}-*
|
||||||
@ -643,94 +486,25 @@ jobs:
|
|||||||
failOnError: false
|
failOnError: false
|
||||||
|
|
||||||
download-and-cache-deb:
|
download-and-cache-deb:
|
||||||
needs: [get-environment, merge-package-deb-artifacts]
|
needs: [merge-package-deb-artifacts]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
distrib: [bullseye, bookworm, jammy, noble]
|
distrib: [bullseye, bookworm, jammy]
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
- uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
|
||||||
with:
|
with:
|
||||||
name: packages-deb-${{ matrix.distrib }}
|
name: packages-deb-${{ matrix.distrib }}
|
||||||
path: ./
|
path: ./
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.deb
|
path: ./*.deb
|
||||||
key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||||
|
|
||||||
test-packages:
|
|
||||||
needs: [get-environment, sign-rpm, download-and-cache-deb]
|
|
||||||
strategy:
|
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
|
||||||
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
|
|
||||||
distrib: 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@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
||||||
with:
|
|
||||||
name: install_error_log_${{ matrix.distrib }}-${{ matrix.arch }}
|
|
||||||
path: install_error_${{ matrix.distrib }}_${{ matrix.arch }}.log
|
|
||||||
|
|
||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, sign-rpm, download-and-cache-deb, test-packages]
|
needs: [get-environment, sign-rpm, download-and-cache-deb]
|
||||||
if: |
|
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')) &&
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||||
! cancelled() &&
|
! cancelled() &&
|
||||||
! contains(needs.*.result, 'failure') &&
|
! contains(needs.*.result, 'failure') &&
|
||||||
@ -750,8 +524,6 @@ jobs:
|
|||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: jammy
|
- distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
name: deliver ${{ matrix.distrib }}
|
name: deliver ${{ matrix.distrib }}
|
||||||
steps:
|
steps:
|
||||||
@ -767,12 +539,3 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
|
|
||||||
|
189
.github/workflows/perl-crypt-argon2.yml
vendored
Normal file
189
.github/workflows/perl-crypt-argon2.yml
vendored
Normal file
@ -0,0 +1,189 @@
|
|||||||
|
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.HARBOR_CENTREON_PULL_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||||
|
|
||||||
|
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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
|
with:
|
||||||
|
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
|
||||||
|
path: ./*.${{ matrix.package_extension}}
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
deliver-packages:
|
||||||
|
needs: [get-environment, package]
|
||||||
|
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:
|
||||||
|
include:
|
||||||
|
- distrib: el8
|
||||||
|
package_extension: rpm
|
||||||
|
arch: amd64
|
||||||
|
- distrib: el9
|
||||||
|
package_extension: rpm
|
||||||
|
arch: amd64
|
||||||
|
- distrib: bullseye
|
||||||
|
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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||||
|
|
||||||
|
- name: Delivery
|
||||||
|
uses: ./.github/actions/package-delivery
|
||||||
|
with:
|
||||||
|
module_name: perl-crypt-argon2-${{ matrix.arch }}
|
||||||
|
distrib: ${{ matrix.distrib }}
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
cache_key: cache-${{ github.sha }}-rpm-perl-crypt-argon2-${{ 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 }}
|
36
.github/workflows/perl-filesys-smbclient.yml
vendored
36
.github/workflows/perl-filesys-smbclient.yml
vendored
@ -24,9 +24,7 @@ jobs:
|
|||||||
|
|
||||||
package-rpm:
|
package-rpm:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
@ -63,16 +61,13 @@ jobs:
|
|||||||
cp -r ~/rpmbuild/RPMS/x86_64/*.rpm .
|
cp -r ~/rpmbuild/RPMS/x86_64/*.rpm .
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.rpm
|
path: ./*.rpm
|
||||||
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||||
|
|
||||||
sign-rpm:
|
sign-rpm:
|
||||||
needs: [get-environment, package-rpm]
|
needs: [package-rpm]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -97,7 +92,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.rpm
|
path: ./*.rpm
|
||||||
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||||
@ -108,16 +103,14 @@ jobs:
|
|||||||
- run: rpmsign --addsign ./*.rpm
|
- run: rpmsign --addsign ./*.rpm
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.rpm
|
path: ./*.rpm
|
||||||
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||||
|
|
||||||
package-deb:
|
package-deb:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
@ -129,9 +122,6 @@ jobs:
|
|||||||
distrib: bookworm
|
distrib: bookworm
|
||||||
- image: packaging-plugins-jammy
|
- image: packaging-plugins-jammy
|
||||||
distrib: jammy
|
distrib: jammy
|
||||||
- image: packaging-plugins-noble
|
|
||||||
distrib: noble
|
|
||||||
|
|
||||||
name: package ${{ matrix.distrib }}
|
name: package ${{ matrix.distrib }}
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||||
@ -158,7 +148,7 @@ 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/
|
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
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.deb
|
path: ./*.deb
|
||||||
key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
|
||||||
@ -166,7 +156,6 @@ jobs:
|
|||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, sign-rpm, package-deb]
|
needs: [get-environment, sign-rpm, package-deb]
|
||||||
if: |
|
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')) &&
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||||
! cancelled() &&
|
! cancelled() &&
|
||||||
! contains(needs.*.result, 'failure') &&
|
! contains(needs.*.result, 'failure') &&
|
||||||
@ -186,8 +175,6 @@ jobs:
|
|||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: jammy
|
- distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
name: deliver ${{ matrix.distrib }}
|
name: deliver ${{ matrix.distrib }}
|
||||||
steps:
|
steps:
|
||||||
@ -203,12 +190,3 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
name: centreon-plugins-sudoers
|
name: perl-json-path
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -8,25 +8,25 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- "dependencies/centreon-plugins-sudoers/**"
|
- "dependencies/perl-json-path/**"
|
||||||
|
- ".github/workflows/perl-json-path.yml"
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
|
- dev-[2-9][0-9].[0-9][0-9].x
|
||||||
- master
|
- master
|
||||||
|
- "[2-9][0-9].[0-9][0-9].x"
|
||||||
paths:
|
paths:
|
||||||
- "dependencies/centreon-plugins-sudoers/**"
|
- "dependencies/perl-json-path/**"
|
||||||
|
- ".github/workflows/perl-json-path.yml"
|
||||||
|
|
||||||
env:
|
|
||||||
module_name: centreon-plugins-sudoers
|
|
||||||
jobs:
|
jobs:
|
||||||
get-environment:
|
get-environment:
|
||||||
uses: ./.github/workflows/get-environment.yml
|
uses: ./.github/workflows/get-environment.yml
|
||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -47,11 +47,8 @@ jobs:
|
|||||||
- image: packaging-plugins-jammy
|
- image: packaging-plugins-jammy
|
||||||
distrib: jammy
|
distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- image: packaging-plugins-noble
|
|
||||||
distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}:latest
|
||||||
@ -65,26 +62,77 @@ jobs:
|
|||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
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
|
- name: Package
|
||||||
uses: ./.github/actions/package-nfpm
|
uses: ./.github/actions/package-nfpm
|
||||||
with:
|
with:
|
||||||
nfpm_file_pattern: "dependencies/centreon-plugins-sudoers/centreon-plugins-sudoers.yaml"
|
nfpm_file_pattern: "dependencies/perl-json-path/perl-json-path.yaml"
|
||||||
distrib: ${{ matrix.distrib }}
|
distrib: ${{ matrix.distrib }}
|
||||||
package_extension: ${{ matrix.package_extension }}
|
package_extension: ${{ matrix.package_extension }}
|
||||||
version: ${{ needs.get-environment.outputs.version }}
|
release: 3
|
||||||
release: ${{ needs.get-environment.outputs.release }}
|
|
||||||
arch: all
|
arch: all
|
||||||
commit_hash: ${{ github.sha }}
|
commit_hash: ${{ github.sha }}
|
||||||
cache_key: cache-${{ github.run_id }}-${{ matrix.package_extension }}-${{ env.module_name }}-${{ matrix.distrib }}
|
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_key: ${{ secrets.RPM_GPG_SIGNING_KEY }}
|
||||||
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
|
rpm_gpg_signing_key_id: ${{ secrets.RPM_GPG_SIGNING_KEY_ID }}
|
||||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
|
|
||||||
|
# set condition to true if artifacts are needed
|
||||||
|
- if: ${{ false }}
|
||||||
|
name: Upload package artifacts
|
||||||
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
|
with:
|
||||||
|
name: packages-${{ matrix.distrib }}
|
||||||
|
path: ./*.${{ matrix.package_extension}}
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, package]
|
needs: [get-environment, package]
|
||||||
if: |
|
if: |
|
||||||
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch'))
|
(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
|
runs-on: ubuntu-24.04
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -100,8 +148,6 @@ jobs:
|
|||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: jammy
|
- distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
name: deliver ${{ matrix.distrib }}
|
name: deliver ${{ matrix.distrib }}
|
||||||
steps:
|
steps:
|
||||||
@ -111,18 +157,9 @@ jobs:
|
|||||||
- name: Delivery
|
- name: Delivery
|
||||||
uses: ./.github/actions/package-delivery
|
uses: ./.github/actions/package-delivery
|
||||||
with:
|
with:
|
||||||
module_name: ${{ env.module_name }}
|
module_name: perl-json-path
|
||||||
distrib: ${{ matrix.distrib }}
|
distrib: ${{ matrix.distrib }}
|
||||||
cache_key: cache-${{ github.run_id }}-${{ matrix.package_extension }}-${{ env.module_name }}-${{ matrix.distrib }}
|
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-json-path-${{ matrix.distrib }}-${{ github.head_ref || github.ref_name }}
|
||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
|
|
17
.github/workflows/perl-keepass-reader.yml
vendored
17
.github/workflows/perl-keepass-reader.yml
vendored
@ -27,9 +27,6 @@ jobs:
|
|||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -50,9 +47,6 @@ jobs:
|
|||||||
- image: packaging-plugins-jammy
|
- image: packaging-plugins-jammy
|
||||||
distrib: jammy
|
distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- image: packaging-plugins-noble
|
|
||||||
distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
@ -145,8 +139,6 @@ jobs:
|
|||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: jammy
|
- distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
name: deliver ${{ matrix.distrib }}
|
name: deliver ${{ matrix.distrib }}
|
||||||
steps:
|
steps:
|
||||||
@ -162,12 +154,3 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
|
|
||||||
|
187
.github/workflows/perl-libssh-session.yml
vendored
Normal file
187
.github/workflows/perl-libssh-session.yml
vendored
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
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.HARBOR_CENTREON_PULL_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||||
|
|
||||||
|
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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
|
with:
|
||||||
|
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
|
||||||
|
path: ./*.${{ matrix.package_extension}}
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
deliver-packages:
|
||||||
|
needs: [get-environment, package]
|
||||||
|
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:
|
||||||
|
include:
|
||||||
|
- distrib: el8
|
||||||
|
package_extension: rpm
|
||||||
|
arch: amd64
|
||||||
|
- distrib: el9
|
||||||
|
package_extension: rpm
|
||||||
|
arch: amd64
|
||||||
|
- distrib: bullseye
|
||||||
|
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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||||
|
|
||||||
|
- name: Delivery
|
||||||
|
uses: ./.github/actions/package-delivery
|
||||||
|
with:
|
||||||
|
module_name: perl-libssh-session-${{ matrix.arch }}
|
||||||
|
distrib: ${{ matrix.distrib }}
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-libssh-session-${{ 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 }}
|
187
.github/workflows/perl-net-curl.yml
vendored
Normal file
187
.github/workflows/perl-net-curl.yml
vendored
Normal file
@ -0,0 +1,187 @@
|
|||||||
|
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.HARBOR_CENTREON_PULL_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||||
|
|
||||||
|
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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
|
with:
|
||||||
|
name: packages-${{ matrix.distrib }}-${{ matrix.arch }}
|
||||||
|
path: ./*.${{ matrix.package_extension }}
|
||||||
|
retention-days: 1
|
||||||
|
|
||||||
|
deliver-packages:
|
||||||
|
needs: [get-environment, package]
|
||||||
|
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:
|
||||||
|
include:
|
||||||
|
- distrib: el8
|
||||||
|
package_extension: rpm
|
||||||
|
arch: amd64
|
||||||
|
- distrib: el9
|
||||||
|
package_extension: rpm
|
||||||
|
arch: amd64
|
||||||
|
- distrib: bullseye
|
||||||
|
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 }}
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||||
|
|
||||||
|
- name: Delivery
|
||||||
|
uses: ./.github/actions/package-delivery
|
||||||
|
with:
|
||||||
|
module_name: perl-net-curl-${{ matrix.arch }}
|
||||||
|
distrib: ${{ matrix.distrib }}
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
cache_key: cache-${{ github.sha }}-${{ matrix.package_extension }}-perl-net-curl-${{ 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 }}
|
27
.github/workflows/perl-openwsman.yml
vendored
27
.github/workflows/perl-openwsman.yml
vendored
@ -22,9 +22,7 @@ jobs:
|
|||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -55,15 +53,10 @@ jobs:
|
|||||||
package_extension: deb
|
package_extension: deb
|
||||||
runner: ubuntu-22.04
|
runner: ubuntu-22.04
|
||||||
arch: amd64
|
arch: amd64
|
||||||
- image: packaging-plugins-noble
|
|
||||||
distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
runner: ubuntu-22.04
|
|
||||||
arch: amd64
|
|
||||||
- image: packaging-plugins-bullseye-arm64
|
- image: packaging-plugins-bullseye-arm64
|
||||||
distrib: bullseye
|
distrib: bullseye
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
runner: centreon-collect-arm64
|
runner: ["self-hosted", "collect-arm64"]
|
||||||
arch: arm64
|
arch: arm64
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner }}
|
runs-on: ${{ matrix.runner }}
|
||||||
@ -213,7 +206,7 @@ jobs:
|
|||||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
||||||
with:
|
with:
|
||||||
path: ./*.${{ matrix.package_extension }}
|
path: ./*.${{ matrix.package_extension }}
|
||||||
key: cache-${{ github.sha }}-${{ matrix.package_extension }}-wsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
key: cache-${{ github.sha }}-${{ matrix.package_extension }}-wsman-${{ matrix.distrib }}-${{ matrix.arch }}-${{ github.head_ref || github.ref_name }}
|
||||||
@ -221,7 +214,6 @@ jobs:
|
|||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, package]
|
needs: [get-environment, package]
|
||||||
if: |
|
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')) &&
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||||
! cancelled() &&
|
! cancelled() &&
|
||||||
! contains(needs.*.result, 'failure') &&
|
! contains(needs.*.result, 'failure') &&
|
||||||
@ -249,10 +241,6 @@ jobs:
|
|||||||
- distrib: jammy
|
- distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
arch: amd64
|
arch: amd64
|
||||||
- distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
arch: amd64
|
|
||||||
|
|
||||||
|
|
||||||
name: deliver ${{ matrix.distrib }} ${{ matrix.arch }}
|
name: deliver ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||||
steps:
|
steps:
|
||||||
@ -269,12 +257,3 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
|
|
||||||
|
193
.github/workflows/perl-vmware-vsphere.yml
vendored
Normal file
193
.github/workflows/perl-vmware-vsphere.yml
vendored
Normal file
@ -0,0 +1,193 @@
|
|||||||
|
name: perl-vmware-vsphere
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
pull_request:
|
||||||
|
paths:
|
||||||
|
- 'dependencies/perl-vmware-vsphere/**'
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- develop
|
||||||
|
- master
|
||||||
|
paths:
|
||||||
|
- 'dependencies/perl-vmware-vsphere/**'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
get-environment:
|
||||||
|
uses: ./.github/workflows/get-environment.yml
|
||||||
|
with:
|
||||||
|
version_file: connectors/vmware/src/centreon/script/centreon_vmware.pm
|
||||||
|
|
||||||
|
get-sources:
|
||||||
|
needs: [get-environment]
|
||||||
|
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Download vsphere cli sources
|
||||||
|
run: |
|
||||||
|
wget https://gitlab.labexposed.com/centreon-lab/perl-VMware-vSphere/-/raw/master/storage/VMware-vSphere-Perl-SDK-7.0.0-17698549.x86_64.tar.gz
|
||||||
|
tar zxf VMware-vSphere-Perl-SDK-7.0.0-17698549.x86_64.tar.gz
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Build vsphere cli sources
|
||||||
|
run: |
|
||||||
|
cd vmware-vsphere-cli-distrib
|
||||||
|
perl Makefile.PL
|
||||||
|
sudo make pure_install
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Cache vsphere cli sources
|
||||||
|
uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
|
with:
|
||||||
|
path: vmware-vsphere-cli-distrib
|
||||||
|
key: ${{ github.sha }}-${{ github.run_id }}-sources-perl-vmware-vsphere
|
||||||
|
|
||||||
|
package:
|
||||||
|
needs: [get-environment, get-sources]
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
include:
|
||||||
|
- package_extension: rpm
|
||||||
|
image: packaging-plugins-alma8
|
||||||
|
distrib: el8
|
||||||
|
runner: ubuntu-22.04
|
||||||
|
arch: amd64
|
||||||
|
- package_extension: rpm
|
||||||
|
image: packaging-plugins-alma9
|
||||||
|
distrib: el9
|
||||||
|
runner: ubuntu-22.04
|
||||||
|
arch: amd64
|
||||||
|
- package_extension: deb
|
||||||
|
image: packaging-plugins-bullseye
|
||||||
|
distrib: bullseye
|
||||||
|
runner: ubuntu-22.04
|
||||||
|
arch: amd64
|
||||||
|
- package_extension: deb
|
||||||
|
image: packaging-plugins-bookworm
|
||||||
|
distrib: bookworm
|
||||||
|
runner: ubuntu-22.04
|
||||||
|
arch: amd64
|
||||||
|
- package_extension: deb
|
||||||
|
image: packaging-plugins-jammy
|
||||||
|
distrib: jammy
|
||||||
|
runner: ubuntu-22.04
|
||||||
|
arch: amd64
|
||||||
|
- package_extension: deb
|
||||||
|
image: packaging-plugins-bullseye-arm64
|
||||||
|
distrib: bullseye
|
||||||
|
runner: ["self-hosted", "collect-arm64"]
|
||||||
|
arch: arm64
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.runner }}
|
||||||
|
|
||||||
|
container:
|
||||||
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||||
|
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||||
|
|
||||||
|
name: package ${{ matrix.distrib }} ${{ matrix.arch }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout sources
|
||||||
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
|
- name: Import source files
|
||||||
|
uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
|
with:
|
||||||
|
path: vmware-vsphere-cli-distrib
|
||||||
|
key: ${{ github.sha }}-${{ github.run_id }}-sources-perl-vmware-vsphere
|
||||||
|
fail-on-cache-miss: true
|
||||||
|
|
||||||
|
- name: Set 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
|
||||||
|
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
|
||||||
|
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#@PERL_VENDORARCH@#$PERL_VENDORARCH#g" dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml
|
||||||
|
|
||||||
|
cat dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml
|
||||||
|
shell: bash
|
||||||
|
|
||||||
|
- name: Package
|
||||||
|
uses: ./.github/actions/package-nfpm
|
||||||
|
with:
|
||||||
|
nfpm_file_pattern: "dependencies/perl-vmware-vsphere/packaging/perl-vmware-vsphere.yaml"
|
||||||
|
distrib: ${{ matrix.distrib }}
|
||||||
|
package_extension: ${{ matrix.package_extension }}
|
||||||
|
arch: ${{ matrix.arch }}
|
||||||
|
commit_hash: ${{ github.sha }}
|
||||||
|
version: "7.0.1"
|
||||||
|
release: "17698549"
|
||||||
|
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}-${{ matrix.arch }}
|
||||||
|
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 }}
|
||||||
|
|
||||||
|
deliver-packages:
|
||||||
|
needs: [get-environment, package]
|
||||||
|
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:
|
||||||
|
include:
|
||||||
|
- distrib: el8
|
||||||
|
package_extension: rpm
|
||||||
|
arch: amd64
|
||||||
|
- distrib: el9
|
||||||
|
package_extension: rpm
|
||||||
|
arch: amd64
|
||||||
|
- distrib: bullseye
|
||||||
|
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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||||
|
|
||||||
|
- name: Delivery
|
||||||
|
uses: ./.github/actions/package-delivery
|
||||||
|
with:
|
||||||
|
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 }}
|
27
.github/workflows/plink.yml
vendored
27
.github/workflows/plink.yml
vendored
@ -24,9 +24,7 @@ jobs:
|
|||||||
|
|
||||||
package-rpm:
|
package-rpm:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
if: ${{ needs.get-environment.outputs.stability != 'stable' }}
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -57,16 +55,13 @@ jobs:
|
|||||||
cp -r ~/rpmbuild/RPMS/x86_64/*.rpm .
|
cp -r ~/rpmbuild/RPMS/x86_64/*.rpm .
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.rpm
|
path: ./*.rpm
|
||||||
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||||
|
|
||||||
sign-rpm:
|
sign-rpm:
|
||||||
needs: [get-environment, package-rpm]
|
needs: [package-rpm]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -91,7 +86,7 @@ jobs:
|
|||||||
|
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/restore@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.rpm
|
path: ./*.rpm
|
||||||
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
key: unsigned-${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||||
@ -102,12 +97,12 @@ jobs:
|
|||||||
- run: rpmsign --addsign ./*.rpm
|
- run: rpmsign --addsign ./*.rpm
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@0c45773b623bea8c8e75f6c82b208c3cf94ea4f9 # v4.0.2
|
||||||
with:
|
with:
|
||||||
path: ./*.rpm
|
path: ./*.rpm
|
||||||
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
- uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
with:
|
with:
|
||||||
name: packages-${{ matrix.distrib }}
|
name: packages-${{ matrix.distrib }}
|
||||||
path: ./*.rpm
|
path: ./*.rpm
|
||||||
@ -116,7 +111,6 @@ jobs:
|
|||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, sign-rpm]
|
needs: [get-environment, sign-rpm]
|
||||||
if: |
|
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')) &&
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||||
! cancelled() &&
|
! cancelled() &&
|
||||||
! contains(needs.*.result, 'failure') &&
|
! contains(needs.*.result, 'failure') &&
|
||||||
@ -145,12 +139,3 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
|
|
||||||
|
41
.github/workflows/plugins-analysis.yml
vendored
41
.github/workflows/plugins-analysis.yml
vendored
@ -1,41 +0,0 @@
|
|||||||
name: plugins-analysis
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_dispatch:
|
|
||||||
schedule:
|
|
||||||
- cron: '30 0 * * 1-5'
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
- master
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- develop
|
|
||||||
- master
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
get-environment:
|
|
||||||
uses: ./.github/workflows/get-environment.yml
|
|
||||||
|
|
||||||
checkmarx-analysis:
|
|
||||||
needs: [get-environment]
|
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
github.event.pull_request.draft != 'true'
|
|
||||||
uses: ./.github/workflows/checkmarx-analysis.yml
|
|
||||||
with:
|
|
||||||
module_name: centreon-plugins
|
|
||||||
secrets:
|
|
||||||
base_uri: ${{ secrets.AST_RND_SCANS_BASE_URI }}
|
|
||||||
cx_tenant: ${{ secrets.AST_RND_SCANS_TENANT }}
|
|
||||||
cx_client_id: ${{ secrets.AST_RND_SCANS_CLIENT_ID }}
|
|
||||||
cx_client_secret: ${{ secrets.AST_RND_SCANS_CLIENT_SECRET }}
|
|
||||||
|
|
||||||
set-skip-label:
|
|
||||||
needs: [get-environment, checkmarx-analysis]
|
|
||||||
if: needs.get-environment.outputs.skip_workflow == 'false'
|
|
||||||
uses: ./.github/workflows/set-pull-request-skip-label.yml
|
|
13
.github/workflows/plugins-selinux.yml
vendored
13
.github/workflows/plugins-selinux.yml
vendored
@ -24,9 +24,6 @@ jobs:
|
|||||||
|
|
||||||
package:
|
package:
|
||||||
needs: [get-environment]
|
needs: [get-environment]
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-environment.outputs.stability != 'stable'
|
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
@ -75,7 +72,6 @@ jobs:
|
|||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, package]
|
needs: [get-environment, package]
|
||||||
if: |
|
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')) &&
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||||
! cancelled() &&
|
! cancelled() &&
|
||||||
! contains(needs.*.result, 'failure') &&
|
! contains(needs.*.result, 'failure') &&
|
||||||
@ -104,12 +100,3 @@ jobs:
|
|||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
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
|
|
||||||
|
227
.github/workflows/plugins.yml
vendored
227
.github/workflows/plugins.yml
vendored
@ -1,5 +1,4 @@
|
|||||||
name: plugins
|
name: plugins
|
||||||
run-name: ${{ (github.event_name == 'schedule' || (github.event_name == 'workflow_dispatch' && github.event.inputs.nightly_manual_trigger == 'true')) && format('plugins nightly {0}', github.ref_name) || '' }}
|
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
||||||
@ -7,14 +6,6 @@ concurrency:
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
|
||||||
nightly_manual_trigger:
|
|
||||||
description: 'Set to true to trigger a nightly run'
|
|
||||||
required: true
|
|
||||||
default: false
|
|
||||||
type: boolean
|
|
||||||
schedule:
|
|
||||||
- cron: "30 1 * * 1"
|
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/plugins.yml'
|
- '.github/workflows/plugins.yml'
|
||||||
@ -36,29 +27,24 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
get-environment:
|
get-environment:
|
||||||
uses: ./.github/workflows/get-environment.yml
|
uses: ./.github/workflows/get-environment.yml
|
||||||
with:
|
|
||||||
nightly_manual_trigger: ${{ inputs.nightly_manual_trigger || false }}
|
|
||||||
|
|
||||||
changes:
|
get-plugins:
|
||||||
needs: [get-environment]
|
runs-on: ubuntu-22.04
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
outputs:
|
outputs:
|
||||||
changes_common: ${{ steps.filter.outputs.common || 'true' }}
|
plugins: ${{ steps.get_plugins.outputs.plugins }}
|
||||||
changes_packages: ${{ steps.filter.outputs.packages || 'false' }}
|
|
||||||
changes_plugins: ${{ steps.filter.outputs.plugins || 'false' }}
|
|
||||||
packages_files: ${{ steps.filter.outputs.packages_files }}
|
|
||||||
plugins_files: ${{ steps.filter.outputs.plugins_files }}
|
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
with:
|
||||||
|
fetch-depth: 0
|
||||||
|
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5.2.0
|
||||||
|
with:
|
||||||
|
python-version: '3.9'
|
||||||
|
|
||||||
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
- uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
|
||||||
id: filter
|
id: filter
|
||||||
if: |
|
|
||||||
github.event_name == 'pull_request' &&
|
|
||||||
contains(fromJson('["testing", "unstable", "canary"]'), needs.get-environment.outputs.stability)
|
|
||||||
with:
|
with:
|
||||||
base: ${{ github.head_ref || github.ref_name }}
|
base: ${{ github.ref }}
|
||||||
list-files: shell
|
list-files: shell
|
||||||
filters: |
|
filters: |
|
||||||
common:
|
common:
|
||||||
@ -69,24 +55,10 @@ jobs:
|
|||||||
plugins:
|
plugins:
|
||||||
- added|modified: src/**
|
- added|modified: src/**
|
||||||
|
|
||||||
get-plugins:
|
|
||||||
runs-on: ubuntu-24.04
|
|
||||||
needs: [get-environment, changes]
|
|
||||||
outputs:
|
|
||||||
plugins: ${{ steps.get_plugins.outputs.plugins }}
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
||||||
with:
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
||||||
with:
|
|
||||||
python-version: '3.9'
|
|
||||||
|
|
||||||
- name: transform to directories
|
- name: transform to directories
|
||||||
run: |
|
run: |
|
||||||
folders=()
|
folders=()
|
||||||
for f in ${{ needs.changes.outputs.packages_files }}; do
|
for f in ${{ steps.filter.outputs.packages_files }}; do
|
||||||
echo "Adding $(dirname $f) to folders"
|
echo "Adding $(dirname $f) to folders"
|
||||||
folders+=($(dirname $f))
|
folders+=($(dirname $f))
|
||||||
done
|
done
|
||||||
@ -94,7 +66,7 @@ jobs:
|
|||||||
jq --compact-output --null-input '$ARGS.positional' --args -- ${unique_folders[@]} > package_directories.txt
|
jq --compact-output --null-input '$ARGS.positional' --args -- ${unique_folders[@]} > package_directories.txt
|
||||||
|
|
||||||
files=()
|
files=()
|
||||||
for f in ${{ needs.changes.outputs.plugins_files }}; do
|
for f in ${{ steps.filter.outputs.plugins_files }}; do
|
||||||
echo "Adding $f to files"
|
echo "Adding $f to files"
|
||||||
files+=($f)
|
files+=($f)
|
||||||
done
|
done
|
||||||
@ -104,9 +76,9 @@ jobs:
|
|||||||
|
|
||||||
- name: Get plugins for build
|
- name: Get plugins for build
|
||||||
id: get_plugins
|
id: get_plugins
|
||||||
if: ${{ needs.changes.outputs.changes_common == 'true' || needs.changes.outputs.changes_packages == 'true' || needs.changes.outputs.changes_plugins == 'true' }}
|
if: ${{ steps.filter.outputs.common == 'true' || steps.filter.outputs.packages == 'true' || steps.filter.outputs.plugins == 'true' }}
|
||||||
run: |
|
run: |
|
||||||
PLUGINS="$(python3 .github/scripts/process-plugins.py '${{ needs.changes.outputs.changes_common == 'true' }}')"
|
PLUGINS="$(python3 .github/scripts/process-plugins.py '${{ steps.filter.outputs.common == 'true' }}')"
|
||||||
|
|
||||||
echo "plugins=$(echo $PLUGINS)" >> $GITHUB_OUTPUT
|
echo "plugins=$(echo $PLUGINS)" >> $GITHUB_OUTPUT
|
||||||
if [ "$PLUGINS" == '' ]; then
|
if [ "$PLUGINS" == '' ]; then
|
||||||
@ -115,34 +87,14 @@ jobs:
|
|||||||
|
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Create Jira ticket on nightly build failure
|
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.is_nightly == 'true' && github.run_attempt == 1 &&
|
|
||||||
failure() &&
|
|
||||||
startsWith(github.ref_name, 'dev')
|
|
||||||
uses: ./.github/actions/create-jira-ticket
|
|
||||||
with:
|
|
||||||
jira_base_url: ${{ secrets.JIRA_BASE_URL }}
|
|
||||||
jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
|
|
||||||
jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
|
|
||||||
module_name: "monitoring-plugins"
|
|
||||||
ticket_labels: '["Nightly", "Pipeline", "nightly-${{ github.ref_name }}", "${{ github.job }}"]'
|
|
||||||
ticket_squad: "DevSecOps"
|
|
||||||
|
|
||||||
unit-tests:
|
unit-tests:
|
||||||
needs: [get-environment, get-plugins]
|
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:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [unit-tests-alma8, unit-tests-alma9, unit-tests-bullseye, unit-tests-bullseye-arm64, unit-tests-bookworm, unit-tests-jammy, unit-tests-noble]
|
image: [unit-tests-alma8, unit-tests-alma9, unit-tests-bullseye, unit-tests-bullseye-arm64, unit-tests-bookworm, unit-tests-jammy]
|
||||||
include:
|
include:
|
||||||
- runner_name: ubuntu-24.04
|
- runner_name: ubuntu-22.04
|
||||||
- package_extension: rpm
|
- package_extension: rpm
|
||||||
image: unit-tests-alma8
|
image: unit-tests-alma8
|
||||||
distrib: el8
|
distrib: el8
|
||||||
@ -154,7 +106,7 @@ jobs:
|
|||||||
distrib: bullseye
|
distrib: bullseye
|
||||||
- package_extension: deb
|
- package_extension: deb
|
||||||
image: unit-tests-bullseye-arm64
|
image: unit-tests-bullseye-arm64
|
||||||
runner_name: centreon-collect-arm64
|
runner_name: ["self-hosted", "collect-arm64"]
|
||||||
distrib: bullseye
|
distrib: bullseye
|
||||||
- package_extension: deb
|
- package_extension: deb
|
||||||
image: unit-tests-bookworm
|
image: unit-tests-bookworm
|
||||||
@ -162,9 +114,6 @@ jobs:
|
|||||||
- package_extension: deb
|
- package_extension: deb
|
||||||
image: unit-tests-jammy
|
image: unit-tests-jammy
|
||||||
distrib: jammy
|
distrib: jammy
|
||||||
- package_extension: deb
|
|
||||||
image: unit-tests-noble
|
|
||||||
distrib: noble
|
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner_name }}
|
runs-on: ${{ matrix.runner_name }}
|
||||||
container:
|
container:
|
||||||
@ -172,51 +121,33 @@ jobs:
|
|||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
username: ${{ secrets.HARBOR_CENTREON_PULL_USERNAME }}
|
||||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- name: Run unit tests
|
- name: Run unit tests
|
||||||
uses: ./.github/actions/unit-tests
|
uses: ./.github/actions/unit-tests
|
||||||
|
|
||||||
- name: Upload logs as artifacts if tests failed
|
- name: Upload logs as artifacts if tests failed
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
with:
|
with:
|
||||||
name: plugin-installation-${{ matrix.distrib }}
|
name: plugin-installation-${{ matrix.distrib }}
|
||||||
path: ./lastlog.jsonl
|
path: ./lastlog.jsonl
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: Create Jira ticket on nightly build failure
|
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.is_nightly == 'true' && github.run_attempt == 1 &&
|
|
||||||
failure() &&
|
|
||||||
startsWith(github.ref_name, 'dev')
|
|
||||||
uses: ./.github/actions/create-jira-ticket
|
|
||||||
with:
|
|
||||||
jira_base_url: ${{ secrets.JIRA_BASE_URL }}
|
|
||||||
jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
|
|
||||||
jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
|
|
||||||
module_name: "monitoring-plugins"
|
|
||||||
ticket_labels: '["Nightly", "Pipeline", "nightly-${{ github.ref_name }}", "${{ github.job }}"]'
|
|
||||||
ticket_squad: "Connectors"
|
|
||||||
|
|
||||||
fatpacker:
|
fatpacker:
|
||||||
|
if: ${{ needs.get-plugins.outputs.plugins != '' }}
|
||||||
needs: [get-environment, get-plugins, unit-tests]
|
needs: [get-environment, get-plugins, unit-tests]
|
||||||
if: |
|
runs-on: ubuntu-22.04
|
||||||
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:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
with:
|
||||||
|
fetch-depth: 1
|
||||||
|
|
||||||
- name: Prepare FatPacker
|
- name: Prepare FatPacker
|
||||||
uses: shogo82148/actions-setup-perl@22423f01bde48fb88785c007e3166fbbbd8e892a # v1.34.0
|
uses: shogo82148/actions-setup-perl@9c1eca9952ccc07f9ca4a2097b63df93d9d138e9 # v1.31.3
|
||||||
with:
|
with:
|
||||||
perl-version: '5.34'
|
perl-version: '5.34'
|
||||||
install-modules-with: cpm
|
install-modules-with: cpm
|
||||||
@ -227,7 +158,7 @@ jobs:
|
|||||||
COMMIT=$(git log -1 HEAD --pretty=format:%h)
|
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)"
|
perl .github/scripts/plugins-source.container.pl "${{ needs.get-plugins.outputs.plugins }}" "${{ needs.get-environment.outputs.version }} ($COMMIT)"
|
||||||
|
|
||||||
- uses: actions/cache/save@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/save@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
||||||
with:
|
with:
|
||||||
path: ./build/
|
path: ./build/
|
||||||
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
||||||
@ -235,13 +166,6 @@ jobs:
|
|||||||
package:
|
package:
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-24.04
|
||||||
needs: [get-environment, get-plugins, fatpacker]
|
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:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@ -265,9 +189,6 @@ jobs:
|
|||||||
- package_extension: deb
|
- package_extension: deb
|
||||||
image: packaging-plugins-jammy
|
image: packaging-plugins-jammy
|
||||||
distrib: jammy
|
distrib: jammy
|
||||||
- package_extension: deb
|
|
||||||
image: packaging-plugins-noble
|
|
||||||
distrib: noble
|
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
|
||||||
@ -279,9 +200,9 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
||||||
with:
|
with:
|
||||||
path: ./build/
|
path: ./build/
|
||||||
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
||||||
@ -361,33 +282,12 @@ jobs:
|
|||||||
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
rpm_gpg_signing_passphrase: ${{ secrets.RPM_GPG_SIGNING_PASSPHRASE }}
|
||||||
stability: ${{ needs.get-environment.outputs.stability }}
|
stability: ${{ needs.get-environment.outputs.stability }}
|
||||||
|
|
||||||
- name: Create Jira ticket on nightly build failure
|
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.is_nightly == 'true' && github.run_attempt == 1 &&
|
|
||||||
failure() &&
|
|
||||||
startsWith(github.ref_name, 'dev')
|
|
||||||
uses: ./.github/actions/create-jira-ticket
|
|
||||||
with:
|
|
||||||
jira_base_url: ${{ secrets.JIRA_BASE_URL }}
|
|
||||||
jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
|
|
||||||
jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
|
|
||||||
module_name: "monitoring-plugins"
|
|
||||||
ticket_labels: '["Nightly", "Pipeline", "nightly-${{ github.ref_name }}", "${{ github.job }}"]'
|
|
||||||
ticket_squad: "DevSecOps"
|
|
||||||
|
|
||||||
test-plugins:
|
test-plugins:
|
||||||
needs: [get-environment, get-plugins, package]
|
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:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image: [testing-plugins-alma8, testing-plugins-alma9, testing-plugins-jammy, testing-plugins-bullseye, testing-plugins-bookworm, testing-plugins-noble, testing-plugins-bullseye-arm64]
|
image: [testing-plugins-alma8, testing-plugins-alma9, testing-plugins-jammy, testing-plugins-bullseye, testing-plugins-bookworm]
|
||||||
include:
|
include:
|
||||||
- runner_name: ubuntu-24.04
|
- runner_name: ubuntu-24.04
|
||||||
- package_extension: rpm
|
- package_extension: rpm
|
||||||
@ -405,14 +305,11 @@ jobs:
|
|||||||
- package_extension: deb
|
- package_extension: deb
|
||||||
image: testing-plugins-jammy
|
image: testing-plugins-jammy
|
||||||
distrib: jammy
|
distrib: jammy
|
||||||
- package_extension: deb
|
|
||||||
image: testing-plugins-noble
|
|
||||||
distrib: noble
|
|
||||||
- package_extension: deb
|
- package_extension: deb
|
||||||
image: testing-plugins-bullseye-arm64
|
image: testing-plugins-bullseye-arm64
|
||||||
distrib: bullseye
|
distrib: bullseye
|
||||||
arch: arm64
|
arch: arm64
|
||||||
runner_name: centreon-collect-arm64
|
runner_name: ["self-hosted", "collect-arm64"]
|
||||||
|
|
||||||
runs-on: ${{ matrix.runner_name }}
|
runs-on: ${{ matrix.runner_name }}
|
||||||
container:
|
container:
|
||||||
@ -422,7 +319,7 @@ jobs:
|
|||||||
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
password: ${{ secrets.HARBOR_CENTREON_PULL_TOKEN }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
|
|
||||||
- uses: ./.github/actions/test-plugins
|
- uses: ./.github/actions/test-plugins
|
||||||
with:
|
with:
|
||||||
@ -432,32 +329,17 @@ jobs:
|
|||||||
|
|
||||||
- name: Upload apt/dnf logs as artifacts if tests failed
|
- name: Upload apt/dnf logs as artifacts if tests failed
|
||||||
if: failure()
|
if: failure()
|
||||||
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
|
||||||
with:
|
with:
|
||||||
name: plugin-installation-${{ matrix.distrib }}
|
name: plugin-installation-${{ matrix.distrib }}
|
||||||
path: /var/log/robot-plugins-installation-tests.log
|
path: /var/log/robot-plugins-installation-tests.log
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
- name: Create Jira ticket on nightly build failure
|
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.is_nightly == 'true' && github.run_attempt == 1 &&
|
|
||||||
failure() &&
|
|
||||||
startsWith(github.ref_name, 'dev')
|
|
||||||
uses: ./.github/actions/create-jira-ticket
|
|
||||||
with:
|
|
||||||
jira_base_url: ${{ secrets.JIRA_BASE_URL }}
|
|
||||||
jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
|
|
||||||
jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
|
|
||||||
module_name: "monitoring-plugins"
|
|
||||||
ticket_labels: '["Nightly", "Pipeline", "nightly-${{ github.ref_name }}", "${{ github.job }}"]'
|
|
||||||
ticket_squad: "Connectors"
|
|
||||||
|
|
||||||
deliver-packages:
|
deliver-packages:
|
||||||
needs: [get-environment, get-plugins, test-plugins]
|
needs: [get-environment, get-plugins, test-plugins]
|
||||||
if: |
|
if: |
|
||||||
needs.get-environment.outputs.skip_workflow == 'false' &&
|
|
||||||
needs.get-plugins.outputs.plugins != '' &&
|
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')) &&
|
(contains(fromJson('["testing", "unstable"]'), needs.get-environment.outputs.stability) || ( needs.get-environment.outputs.stability == 'stable' && github.event_name != 'workflow_dispatch')) &&
|
||||||
! cancelled() &&
|
! cancelled() &&
|
||||||
! contains(needs.*.result, 'failure') &&
|
! contains(needs.*.result, 'failure') &&
|
||||||
! contains(needs.*.result, 'cancelled')
|
! contains(needs.*.result, 'cancelled')
|
||||||
@ -478,13 +360,11 @@ jobs:
|
|||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: jammy
|
- distrib: jammy
|
||||||
package_extension: deb
|
package_extension: deb
|
||||||
- distrib: noble
|
|
||||||
package_extension: deb
|
|
||||||
|
|
||||||
name: deliver ${{ matrix.distrib }}
|
name: deliver ${{ matrix.distrib }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||||
|
|
||||||
- name: Delivery
|
- name: Delivery
|
||||||
uses: ./.github/actions/package-delivery
|
uses: ./.github/actions/package-delivery
|
||||||
@ -496,32 +376,16 @@ jobs:
|
|||||||
release_type: ${{ needs.get-environment.outputs.release_type }}
|
release_type: ${{ needs.get-environment.outputs.release_type }}
|
||||||
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
|
||||||
|
|
||||||
- name: Create Jira ticket on nightly build failure
|
|
||||||
if: |
|
|
||||||
needs.get-environment.outputs.is_nightly == 'true' && github.run_attempt == 1 &&
|
|
||||||
failure() &&
|
|
||||||
startsWith(github.ref_name, 'dev')
|
|
||||||
uses: ./.github/actions/create-jira-ticket
|
|
||||||
with:
|
|
||||||
jira_base_url: ${{ secrets.JIRA_BASE_URL }}
|
|
||||||
jira_user_email: ${{ secrets.XRAY_JIRA_USER_EMAIL }}
|
|
||||||
jira_api_token: ${{ secrets.XRAY_JIRA_TOKEN }}
|
|
||||||
module_name: "monitoring-plugins"
|
|
||||||
ticket_labels: '["Nightly", "Pipeline", "nightly-${{ github.ref_name }}", "${{ github.job }}"]'
|
|
||||||
ticket_squad: "DevSecOps"
|
|
||||||
|
|
||||||
deliver-sources:
|
deliver-sources:
|
||||||
needs: [get-environment, fatpacker]
|
needs: [get-environment]
|
||||||
if: |
|
if: ${{ needs.get-environment.outputs.stability == 'stable' && github.event_name == 'push' }}
|
||||||
needs.get-environment.outputs.stability == 'stable' &&
|
runs-on: [self-hosted, common]
|
||||||
github.event_name == 'push'
|
|
||||||
runs-on: centreon-common
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||||
|
|
||||||
- uses: actions/cache/restore@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
|
- uses: actions/cache/restore@6849a6489940f00c2f30c0fb92c6274307ccb58a # v4.1.2
|
||||||
with:
|
with:
|
||||||
path: ./build/
|
path: ./build/
|
||||||
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
key: fatpacked-plugins-${{ github.sha }}-${{ github.run_id }}
|
||||||
@ -544,11 +408,11 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout sources
|
- name: Checkout sources
|
||||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
|
||||||
|
|
||||||
- name: Push git release tag
|
- name: Push git release tag
|
||||||
run: |
|
run: |
|
||||||
RELEASE=plugins-${{ needs.get-environment.outputs.version }}
|
RELEASE=plugins-$(date '+%Y%m%d')
|
||||||
|
|
||||||
EXISTING_TAG=$(git tag --list "$RELEASE" | head -n 1)
|
EXISTING_TAG=$(git tag --list "$RELEASE" | head -n 1)
|
||||||
|
|
||||||
@ -562,12 +426,3 @@ jobs:
|
|||||||
echo "::warning::Release tag $RELEASE already exists"
|
echo "::warning::Release tag $RELEASE already exists"
|
||||||
fi
|
fi
|
||||||
shell: bash
|
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
|
|
||||||
|
@ -1,32 +0,0 @@
|
|||||||
name: set-pull-request-external-label
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
|
|
||||||
cancel-in-progress: true
|
|
||||||
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
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}`);
|
|
||||||
}
|
|
@ -1,26 +0,0 @@
|
|||||||
name: set-pull-request-skip-label
|
|
||||||
|
|
||||||
on:
|
|
||||||
workflow_call:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
set-pull-request-skip-label:
|
|
||||||
if: ${{ success() && contains(fromJSON('["pull_request"]') , 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:
|
jobs:
|
||||||
pod-spell-check:
|
pod-spell-check:
|
||||||
if: ${{ !contains(github.event.pull_request.labels.*.name, 'do-not-spellcheck') }}
|
if: ${{ !contains(github.event.pull_request.labels.*.name, 'do-not-spellcheck') }}
|
||||||
runs-on: ubuntu-24.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
||||||
@ -30,11 +30,11 @@ jobs:
|
|||||||
- added|modified: 'src/**/*.pm'
|
- added|modified: 'src/**/*.pm'
|
||||||
|
|
||||||
- name: Install CPAN Libraries
|
- name: Install CPAN Libraries
|
||||||
uses: shogo82148/actions-setup-perl@22423f01bde48fb88785c007e3166fbbbd8e892a # v1.34.0
|
uses: shogo82148/actions-setup-perl@9c1eca9952ccc07f9ca4a2097b63df93d9d138e9 # v1.31.3
|
||||||
with:
|
with:
|
||||||
perl-version: '5.34'
|
perl-version: '5.34'
|
||||||
install-modules-with: cpm
|
install-modules-with: cpm
|
||||||
install-modules: Test::More Test::Spelling List::MoreUtils
|
install-modules: Test::More Test::Spelling
|
||||||
|
|
||||||
- name: Install librairies
|
- name: Install librairies
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -1,5 +1,3 @@
|
|||||||
log.html
|
log.html
|
||||||
output.xml
|
output.xml
|
||||||
report.html
|
report.html
|
||||||
.editorconfig
|
|
||||||
.idea
|
|
||||||
|
@ -1,25 +0,0 @@
|
|||||||
title = "Gitleaks custom rules"
|
|
||||||
|
|
||||||
[extend]
|
|
||||||
useDefault = true
|
|
||||||
|
|
||||||
[allowlist]
|
|
||||||
paths = [
|
|
||||||
'''node_modules\/''',
|
|
||||||
'''vendor\/''',
|
|
||||||
'''(.*?)\.rptlibrary''',
|
|
||||||
'''package\.json''',
|
|
||||||
'''package-lock\.json''',
|
|
||||||
'''pnpm-lock\.yaml''',
|
|
||||||
'''composer\.json''',
|
|
||||||
'''composer\.lock''',
|
|
||||||
'''yarn\.lock''',
|
|
||||||
'''\.gitleaks\.toml$''',
|
|
||||||
'''(.*?)(jpg|gif|doc|pdf|bin)$'''
|
|
||||||
]
|
|
||||||
|
|
||||||
regexTarget = "match"
|
|
||||||
regexes = [
|
|
||||||
'''ABCDEFG1234567890''',
|
|
||||||
'''s.aBCD123DEF456GHI789JKL012'''
|
|
||||||
]
|
|
@ -1 +0,0 @@
|
|||||||
20250800
|
|
@ -26,7 +26,6 @@ import java.text.NumberFormat;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
import com.ibm.as400.access.AS400;
|
import com.ibm.as400.access.AS400;
|
||||||
import com.ibm.as400.access.SecureAS400;
|
|
||||||
import com.ibm.as400.access.AS400SecurityException;
|
import com.ibm.as400.access.AS400SecurityException;
|
||||||
import com.ibm.as400.access.ConnectionEvent;
|
import com.ibm.as400.access.ConnectionEvent;
|
||||||
import com.ibm.as400.access.ConnectionListener;
|
import com.ibm.as400.access.ConnectionListener;
|
||||||
@ -45,13 +44,11 @@ public abstract class AbstractHandler {
|
|||||||
protected String host = null;
|
protected String host = null;
|
||||||
protected String login = null;
|
protected String login = null;
|
||||||
protected String password = null;
|
protected String password = null;
|
||||||
protected Integer ssl = 0;
|
|
||||||
|
|
||||||
public AbstractHandler(final String host, final String login, final String password, final Integer ssl) {
|
public AbstractHandler(final String host, final String login, final String password) {
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.login = login;
|
this.login = login;
|
||||||
this.password = password;
|
this.password = password;
|
||||||
this.ssl = ssl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@ -80,28 +77,7 @@ public abstract class AbstractHandler {
|
|||||||
properties.setLoginTimeout(Conf.as400LoginTimeout);
|
properties.setLoginTimeout(Conf.as400LoginTimeout);
|
||||||
properties.setSoTimeout(Conf.as400ReadTimeout);
|
properties.setSoTimeout(Conf.as400ReadTimeout);
|
||||||
|
|
||||||
if (this.ssl == 1) {
|
final AS400 system = new AS400(this.host, this.login, this.password);
|
||||||
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.setSocketProperties(properties);
|
||||||
system.addConnectionListener(new ConnectionListener() {
|
system.addConnectionListener(new ConnectionListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -34,8 +34,8 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
|||||||
*/
|
*/
|
||||||
public class CommandHandler extends AbstractHandler implements ICommandHandler {
|
public class CommandHandler extends AbstractHandler implements ICommandHandler {
|
||||||
|
|
||||||
public CommandHandler(final String host, final String login, final String password, final Integer ssl) {
|
public CommandHandler(final String host, final String login, final String password) {
|
||||||
super(host, login, password, ssl);
|
super(host, login, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -38,10 +38,10 @@ public class DiskHandler extends AbstractHandler implements IDiskHandler {
|
|||||||
|
|
||||||
private QyaspolYasp0300PcmlHandler qyaspolPcmlHandler = null;
|
private QyaspolYasp0300PcmlHandler qyaspolPcmlHandler = null;
|
||||||
|
|
||||||
public DiskHandler(final String host, final String login, final String password, final Integer ssl)
|
public DiskHandler(final String host, final String login, final String password)
|
||||||
throws AS400SecurityException, IOException {
|
throws AS400SecurityException, IOException {
|
||||||
super(host, login, password, ssl);
|
super(host, login, password);
|
||||||
this.qyaspolPcmlHandler = new QyaspolYasp0300PcmlHandler(host, login, password, ssl);
|
this.qyaspolPcmlHandler = new QyaspolYasp0300PcmlHandler(host, login, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -37,8 +37,8 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
|||||||
public class JobHandler extends AbstractHandler implements IJobHandler {
|
public class JobHandler extends AbstractHandler implements IJobHandler {
|
||||||
private final JobCache jobCache;
|
private final JobCache jobCache;
|
||||||
|
|
||||||
public JobHandler(final String host, final String login, final String password, final Integer ssl) {
|
public JobHandler(final String host, final String login, final String password) {
|
||||||
super(host, login, password, ssl);
|
super(host, login, password);
|
||||||
this.jobCache = new JobCache(this);
|
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 class JobQueueHandler extends AbstractHandler implements IJobQueueHandler {
|
||||||
|
|
||||||
public JobQueueHandler(final String host, final String login, final String password, final Integer ssl) {
|
public JobQueueHandler(final String host, final String login, final String password) {
|
||||||
super(host, login, password, ssl);
|
super(host, login, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -42,9 +42,9 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
|||||||
*/
|
*/
|
||||||
public class SubSystemHandler extends AbstractHandler implements ISubSystemHandler {
|
public class SubSystemHandler extends AbstractHandler implements ISubSystemHandler {
|
||||||
|
|
||||||
public SubSystemHandler(final String host, final String login, final String password, final Integer ssl)
|
public SubSystemHandler(final String host, final String login, final String password)
|
||||||
throws AS400SecurityException, IOException {
|
throws AS400SecurityException, IOException {
|
||||||
super(host, login, password, ssl);
|
super(host, login, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -45,14 +45,14 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
|||||||
public class SystemHandler extends AbstractHandler implements ISystemHandler {
|
public class SystemHandler extends AbstractHandler implements ISystemHandler {
|
||||||
private SystemStatus status = null;
|
private SystemStatus status = null;
|
||||||
|
|
||||||
public SystemHandler(final String host, final String login, final String password, final Integer ssl)
|
public SystemHandler(final String host, final String login, final String password)
|
||||||
throws AS400SecurityException, IOException {
|
throws AS400SecurityException, IOException {
|
||||||
this(host, login, password, null, ssl);
|
this(host, login, password, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public SystemHandler(final String host, final String login, final String password, SystemStatus as400Status, final Integer ssl)
|
public SystemHandler(final String host, final String login, final String password, SystemStatus as400Status)
|
||||||
throws AS400SecurityException, IOException {
|
throws AS400SecurityException, IOException {
|
||||||
super(host, login, password, ssl);
|
super(host, login, password);
|
||||||
this.status = as400Status == null ? new SystemStatus(getNewAs400()) : as400Status;
|
this.status = as400Status == null ? new SystemStatus(getNewAs400()) : as400Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ import java.util.LinkedList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.ibm.as400.access.AS400;
|
import com.ibm.as400.access.AS400;
|
||||||
import com.ibm.as400.access.SecureAS400;
|
|
||||||
import com.ibm.as400.access.AS400Message;
|
import com.ibm.as400.access.AS400Message;
|
||||||
import com.ibm.as400.access.AS400SecurityException;
|
import com.ibm.as400.access.AS400SecurityException;
|
||||||
import com.ibm.as400.access.ConnectionEvent;
|
import com.ibm.as400.access.ConnectionEvent;
|
||||||
@ -62,13 +61,11 @@ public class QyaspolYasp0300PcmlHandler {
|
|||||||
String host = null;
|
String host = null;
|
||||||
String login = null;
|
String login = null;
|
||||||
String password = null;
|
String password = null;
|
||||||
Integer ssl = 0;
|
|
||||||
|
|
||||||
public QyaspolYasp0300PcmlHandler(final String host, final String login, final String password, final Integer ssl) {
|
public QyaspolYasp0300PcmlHandler(final String host, final String login, final String password) {
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.login = login;
|
this.login = login;
|
||||||
this.password = password;
|
this.password = password;
|
||||||
this.ssl = ssl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addYasp0300Data(final Yasp0300Data data) {
|
public void addYasp0300Data(final Yasp0300Data data) {
|
||||||
@ -241,27 +238,7 @@ public class QyaspolYasp0300PcmlHandler {
|
|||||||
properties.setLoginTimeout(Conf.as400LoginTimeout);
|
properties.setLoginTimeout(Conf.as400LoginTimeout);
|
||||||
properties.setSoTimeout(Conf.as400ReadTimeout);
|
properties.setSoTimeout(Conf.as400ReadTimeout);
|
||||||
|
|
||||||
if (this.ssl == 1) {
|
final AS400 system = new AS400(this.host, this.login, this.password);
|
||||||
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.setSocketProperties(properties);
|
||||||
system.addConnectionListener(new ConnectionListener() {
|
system.addConnectionListener(new ConnectionListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -102,8 +102,8 @@ public class CachedMessageQueueHandler extends AbstractHandler implements ICache
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public CachedMessageQueueHandler(final String host, final String login, final String password, final Integer ssl) {
|
public CachedMessageQueueHandler(final String host, final String login, final String password) {
|
||||||
super(host, login, password, ssl);
|
super(host, login, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -42,8 +42,8 @@ import com.centreon.connector.as400.dispatcher.check.ResponseData;
|
|||||||
*/
|
*/
|
||||||
public class MessageQueueHandler extends AbstractHandler implements IMessageQueueHandler {
|
public class MessageQueueHandler extends AbstractHandler implements IMessageQueueHandler {
|
||||||
|
|
||||||
public MessageQueueHandler(final String host, final String login, final String password, final Integer ssl) {
|
public MessageQueueHandler(final String host, final String login, final String password) {
|
||||||
super(host, login, password, ssl);
|
super(host, login, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -69,8 +69,8 @@ public class WorkWithProblemHandler extends AbstractHandler {
|
|||||||
private final boolean SSL = false;
|
private final boolean SSL = false;
|
||||||
private final String logPrefix;
|
private final String logPrefix;
|
||||||
|
|
||||||
public WorkWithProblemHandler(final String host, final String login, final String password, final Integer ssl) {
|
public WorkWithProblemHandler(final String host, final String login, final String password) {
|
||||||
super(host, login, password, ssl);
|
super(host, login, password);
|
||||||
this.logPrefix = "[" + WorkWithProblemHandler.INSTANCE_ID++ + "]";
|
this.logPrefix = "[" + WorkWithProblemHandler.INSTANCE_ID++ + "]";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,7 +40,5 @@ public interface IClient {
|
|||||||
|
|
||||||
String getAs400CheckType();
|
String getAs400CheckType();
|
||||||
|
|
||||||
Integer getAs400Ssl();
|
|
||||||
|
|
||||||
Object getAs400Arg(String key);
|
Object getAs400Arg(String key);
|
||||||
}
|
}
|
||||||
|
@ -42,7 +42,6 @@ abstract class AbstractClient implements IClient {
|
|||||||
private String as400Password = null;
|
private String as400Password = null;
|
||||||
private String as400CheckType = null;
|
private String as400CheckType = null;
|
||||||
private String as400Args = null;
|
private String as400Args = null;
|
||||||
private Integer as400Ssl = 0;
|
|
||||||
private List<Map<String, String>> argList = new ArrayList<Map<String, String>>();
|
private List<Map<String, String>> argList = new ArrayList<Map<String, String>>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -78,11 +77,6 @@ abstract class AbstractClient implements IClient {
|
|||||||
return this.input.getArg(key);
|
return this.input.getArg(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Integer getAs400Ssl() {
|
|
||||||
return this.input.getSsl();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Map<String , String>> getAs400ArgList(String key) {
|
public List<Map<String , String>> getAs400ArgList(String key) {
|
||||||
Object arg = this.input.getArg(key);
|
Object arg = this.input.getArg(key);
|
||||||
if (arg == null) {
|
if (arg == null) {
|
||||||
|
@ -87,7 +87,6 @@ public class CheckDispatcher {
|
|||||||
private String host = null;
|
private String host = null;
|
||||||
private String login = null;
|
private String login = null;
|
||||||
private String password = null;
|
private String password = null;
|
||||||
private Integer ssl = 0;
|
|
||||||
|
|
||||||
private volatile ConcurrentHashMap<String, Long> filter = new ConcurrentHashMap<String, Long>();
|
private volatile ConcurrentHashMap<String, Long> filter = new ConcurrentHashMap<String, Long>();
|
||||||
|
|
||||||
@ -136,11 +135,10 @@ public class CheckDispatcher {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public CheckDispatcher(final String host, final String login, final String password, final Integer ssl) {
|
public CheckDispatcher(final String host, final String login, final String password) {
|
||||||
this.host = host;
|
this.host = host;
|
||||||
this.login = login;
|
this.login = login;
|
||||||
this.password = password;
|
this.password = password;
|
||||||
this.ssl = ssl;
|
|
||||||
|
|
||||||
this.executorGlobal = new ThreadPoolExecutorPostFilter(5, 10, Conf.workerQueueTimeout, TimeUnit.MILLISECONDS,
|
this.executorGlobal = new ThreadPoolExecutorPostFilter(5, 10, Conf.workerQueueTimeout, TimeUnit.MILLISECONDS,
|
||||||
new LinkedBlockingQueue<Runnable>());
|
new LinkedBlockingQueue<Runnable>());
|
||||||
@ -167,10 +165,6 @@ public class CheckDispatcher {
|
|||||||
return this.password;
|
return this.password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getSsl() {
|
|
||||||
return this.ssl;
|
|
||||||
}
|
|
||||||
|
|
||||||
public synchronized void dispatch(final NetworkClient client) {
|
public synchronized void dispatch(final NetworkClient client) {
|
||||||
|
|
||||||
if (this.filter.containsKey(client.getRawRequest())) {
|
if (this.filter.containsKey(client.getRawRequest())) {
|
||||||
@ -196,52 +190,52 @@ public class CheckDispatcher {
|
|||||||
|
|
||||||
public ICommandHandler getCommandHandler() throws AS400SecurityException, IOException {
|
public ICommandHandler getCommandHandler() throws AS400SecurityException, IOException {
|
||||||
if (this.commandHandler == null) {
|
if (this.commandHandler == null) {
|
||||||
this.commandHandler = new CommandHandler(this.host, this.login, this.password, this.ssl);
|
this.commandHandler = new CommandHandler(this.host, this.login, this.password);
|
||||||
}
|
}
|
||||||
return this.commandHandler;
|
return this.commandHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IDiskHandler getDiskHandler() throws AS400SecurityException, IOException {
|
public IDiskHandler getDiskHandler() throws AS400SecurityException, IOException {
|
||||||
if (this.diskHandler == null) {
|
if (this.diskHandler == null) {
|
||||||
this.diskHandler = new DiskHandler(this.host, this.login, this.password, this.ssl);
|
this.diskHandler = new DiskHandler(this.host, this.login, this.password);
|
||||||
}
|
}
|
||||||
return this.diskHandler;
|
return this.diskHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IJobHandler getJobHandler() throws AS400SecurityException, IOException {
|
public IJobHandler getJobHandler() throws AS400SecurityException, IOException {
|
||||||
if (this.jobHandler == null) {
|
if (this.jobHandler == null) {
|
||||||
this.jobHandler = new JobHandler(this.host, this.login, this.password, this.ssl);
|
this.jobHandler = new JobHandler(this.host, this.login, this.password);
|
||||||
}
|
}
|
||||||
return this.jobHandler;
|
return this.jobHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ISubSystemHandler getSubSystemHandler() throws AS400SecurityException, IOException {
|
public ISubSystemHandler getSubSystemHandler() throws AS400SecurityException, IOException {
|
||||||
if (this.subSystemHandler == null) {
|
if (this.subSystemHandler == null) {
|
||||||
this.subSystemHandler = new SubSystemHandler(this.host, this.login, this.password, this.ssl);
|
this.subSystemHandler = new SubSystemHandler(this.host, this.login, this.password);
|
||||||
}
|
}
|
||||||
return this.subSystemHandler;
|
return this.subSystemHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ISystemHandler getSystemHandler() throws AS400SecurityException, IOException {
|
public ISystemHandler getSystemHandler() throws AS400SecurityException, IOException {
|
||||||
if (this.systemHandler == null) {
|
if (this.systemHandler == null) {
|
||||||
this.systemHandler = new SystemHandler(this.host, this.login, this.password, this.ssl);
|
this.systemHandler = new SystemHandler(this.host, this.login, this.password);
|
||||||
}
|
}
|
||||||
return this.systemHandler;
|
return this.systemHandler;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ICachedMessageQueueHandler getCachedMessageQueueHandler() throws AS400SecurityException, IOException {
|
public ICachedMessageQueueHandler getCachedMessageQueueHandler() throws AS400SecurityException, IOException {
|
||||||
return new CachedMessageQueueHandler(this.host, this.login, this.password, this.ssl);
|
return new CachedMessageQueueHandler(this.host, this.login, this.password);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IMessageQueueHandler getMessageQueueHandler() throws AS400SecurityException, IOException {
|
public IMessageQueueHandler getMessageQueueHandler() throws AS400SecurityException, IOException {
|
||||||
return new MessageQueueHandler(this.host, this.login, this.password, this.ssl);
|
return new MessageQueueHandler(this.host, this.login, this.password);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IJobQueueHandler getJobQueueHandler() throws AS400SecurityException, IOException {
|
public IJobQueueHandler getJobQueueHandler() throws AS400SecurityException, IOException {
|
||||||
return new JobQueueHandler(this.host, this.login, this.password, this.ssl);
|
return new JobQueueHandler(this.host, this.login, this.password);
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkWithProblemHandler getWrkPrbHandler() throws AS400SecurityException, IOException {
|
public WorkWithProblemHandler getWrkPrbHandler() throws AS400SecurityException, IOException {
|
||||||
return new WorkWithProblemHandler(this.host, this.login, this.password, this.ssl);
|
return new WorkWithProblemHandler(this.host, this.login, this.password);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -31,7 +31,6 @@ public class InputData {
|
|||||||
private String password = null;
|
private String password = null;
|
||||||
private String host = null;
|
private String host = null;
|
||||||
private String command = null;
|
private String command = null;
|
||||||
private Integer ssl = null;
|
|
||||||
Map<String, Object> args = null;
|
Map<String, Object> args = null;
|
||||||
|
|
||||||
public InputData() {
|
public InputData() {
|
||||||
@ -45,13 +44,6 @@ public class InputData {
|
|||||||
return this.password;
|
return this.password;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Integer getSsl() {
|
|
||||||
if (this.ssl == null || this.ssl == 0) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getHost() {
|
public String getHost() {
|
||||||
return this.host;
|
return this.host;
|
||||||
}
|
}
|
||||||
|
@ -52,37 +52,37 @@ public class ClientDispatcherImpl implements ClientDispatcher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private synchronized CheckDispatcher createNewCheckDispatcher(final String host, final String login,
|
private synchronized CheckDispatcher createNewCheckDispatcher(final String host, final String login,
|
||||||
final String password, final Integer ssl) throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
final String password) throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
||||||
|
|
||||||
ConnectorLogger.getInstance().info("create new As400 : " + host);
|
ConnectorLogger.getInstance().info("create new As400 : " + host);
|
||||||
|
|
||||||
CheckDispatcher resource = null;
|
CheckDispatcher resource = null;
|
||||||
resource = new CheckDispatcher(host, login, password, ssl);
|
resource = new CheckDispatcher(host, login, password);
|
||||||
|
|
||||||
this.pool.put(resource, System.currentTimeMillis());
|
this.pool.put(resource, System.currentTimeMillis());
|
||||||
|
|
||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CheckDispatcher getAs400(final String host, final String login, final String password, final Integer ssl)
|
private CheckDispatcher getAs400(final String host, final String login, final String password)
|
||||||
throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
||||||
|
|
||||||
for (final CheckDispatcher resource : this.pool.keySet()) {
|
for (final CheckDispatcher resource : this.pool.keySet()) {
|
||||||
if (resource.getHost().equalsIgnoreCase(host) && resource.getLogin().equalsIgnoreCase(login)
|
if (resource.getHost().equalsIgnoreCase(host) && resource.getLogin().equalsIgnoreCase(login)
|
||||||
&& resource.getPassword().equalsIgnoreCase(password) && resource.getSsl() == ssl) {
|
&& resource.getPassword().equalsIgnoreCase(password)) {
|
||||||
this.pool.put(resource, System.currentTimeMillis());
|
this.pool.put(resource, System.currentTimeMillis());
|
||||||
return resource;
|
return resource;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.createNewCheckDispatcher(host, login, password, ssl);
|
return this.createNewCheckDispatcher(host, login, password);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public synchronized void dispatch(final NetworkClient client)
|
public synchronized void dispatch(final NetworkClient client)
|
||||||
throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
throws AS400SecurityException, IOException, DelayedConnectionException, Exception {
|
||||||
final CheckDispatcher checkDispatcher = this.getAs400(client.getAs400Host(), client.getAs400Login(),
|
final CheckDispatcher checkDispatcher = this.getAs400(client.getAs400Host(), client.getAs400Login(),
|
||||||
client.getAs400Password(), client.getAs400Ssl());
|
client.getAs400Password());
|
||||||
checkDispatcher.dispatch(client);
|
checkDispatcher.dispatch(client);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ public class SystemHandlerTest {
|
|||||||
try {
|
try {
|
||||||
SystemStatus as400 = mock(SystemStatus.class);
|
SystemStatus as400 = mock(SystemStatus.class);
|
||||||
when(as400.getSystemPools()).thenReturn(new Vector<Object>().elements());
|
when(as400.getSystemPools()).thenReturn(new Vector<Object>().elements());
|
||||||
SystemHandler sh = new SystemHandler(null, null, null, as400, null);
|
SystemHandler sh = new SystemHandler(null, null, null, as400);
|
||||||
sh.dumpSystem();
|
sh.dumpSystem();
|
||||||
} finally {
|
} finally {
|
||||||
System.setOut(originalOut);
|
System.setOut(originalOut);
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
2025-05-16 Olivier Mercier <omercier@centreon.com> - 20250501
|
|
||||||
* Fix: changed permissions for centreon_vmware.json config file.
|
|
||||||
|
|
||||||
2024-12-05 Olivier Mercier <omercier@centreon.com> - 3.4.0
|
2024-12-05 Olivier Mercier <omercier@centreon.com> - 3.4.0
|
||||||
* Enhancement: systemd service now takes its options from
|
* Enhancement: systemd service now takes its options from
|
||||||
/etc/(default|sysconfig)/centreon_vmware.
|
/etc/(default|sysconfig)/centreon_vmware.
|
||||||
|
@ -76,10 +76,6 @@ contents:
|
|||||||
type: config|noreplace
|
type: config|noreplace
|
||||||
packager: deb
|
packager: deb
|
||||||
|
|
||||||
- src: "config/logrotate/centreon_vmware"
|
|
||||||
dst: "/etc/logrotate.d/centreon_vmware"
|
|
||||||
type: config|noreplace
|
|
||||||
|
|
||||||
- src: "config/centreon_vmware-conf.json"
|
- src: "config/centreon_vmware-conf.json"
|
||||||
dst: "/etc/centreon/centreon_vmware.json"
|
dst: "/etc/centreon/centreon_vmware.json"
|
||||||
type: config|noreplace
|
type: config|noreplace
|
||||||
@ -90,32 +86,26 @@ scripts:
|
|||||||
overrides:
|
overrides:
|
||||||
rpm:
|
rpm:
|
||||||
depends:
|
depends:
|
||||||
- perl(Class::MethodMaker)
|
|
||||||
- perl(Crypt::OpenSSL::AES)
|
- perl(Crypt::OpenSSL::AES)
|
||||||
- perl(Crypt::SSLeay)
|
|
||||||
- perl(IO::Socket::INET6)
|
- perl(IO::Socket::INET6)
|
||||||
- perl(JSON::XS)
|
- perl(JSON::XS)
|
||||||
- perl(LWP::Protocol::https)
|
- perl(LWP::Protocol::https)
|
||||||
- perl(SOAP::Lite)
|
|
||||||
- perl(Text::Template)
|
- perl(Text::Template)
|
||||||
- perl(UUID)
|
|
||||||
- perl(ZMQ::Constants)
|
- perl(ZMQ::Constants)
|
||||||
- perl(ZMQ::LibZMQ4)
|
- perl(ZMQ::LibZMQ4)
|
||||||
- perl-Net-Curl
|
- perl-Net-Curl
|
||||||
|
- perl-VMware-vSphere >= 5.1
|
||||||
deb:
|
deb:
|
||||||
depends:
|
depends:
|
||||||
- libclass-methodmaker-perl
|
|
||||||
- libcrypt-openssl-aes-perl
|
- libcrypt-openssl-aes-perl
|
||||||
- libcrypt-ssleay-perl
|
|
||||||
- libio-socket-inet6-perl
|
- libio-socket-inet6-perl
|
||||||
- libjson-xs-perl
|
- libjson-xs-perl
|
||||||
- liblwp-protocol-https-perl
|
- liblwp-protocol-https-perl
|
||||||
- libnet-curl-perl
|
- libnet-curl-perl
|
||||||
- libsoap-lite-perl
|
|
||||||
- libtext-template-perl
|
- libtext-template-perl
|
||||||
- libuuid-perl
|
|
||||||
- libzmq-constants-perl
|
- libzmq-constants-perl
|
||||||
- libzmq-libzmq4-perl
|
- libzmq-libzmq4-perl
|
||||||
|
- perl-vmware-vsphere
|
||||||
|
|
||||||
rpm:
|
rpm:
|
||||||
signature:
|
signature:
|
||||||
|
@ -1,12 +0,0 @@
|
|||||||
/var/log/centreon/centreon_vmware.log {
|
|
||||||
copytruncate
|
|
||||||
weekly
|
|
||||||
maxsize 50M
|
|
||||||
rotate 12
|
|
||||||
compress
|
|
||||||
delaycompress
|
|
||||||
notifempty
|
|
||||||
missingok
|
|
||||||
su root root
|
|
||||||
}
|
|
||||||
|
|
@ -9,8 +9,8 @@ function migrateConfigFromPmToJson() {
|
|||||||
/usr/bin/centreon_vmware_convert_config_file "$perl_config_file_path" > "$json_config_file_path"
|
/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"
|
mv "$perl_config_file_path" "${perl_config_file_path}.deprecated"
|
||||||
fi
|
fi
|
||||||
chown centreon-gorgone:centreon "$json_config_file_path"
|
chown centreon: "$json_config_file_path"
|
||||||
chmod 660 "$json_config_file_path"
|
chmod 640 "$json_config_file_path"
|
||||||
}
|
}
|
||||||
|
|
||||||
function applyToSystemD() {
|
function applyToSystemD() {
|
||||||
|
@ -54,7 +54,7 @@ BEGIN {
|
|||||||
|
|
||||||
use base qw(centreon::vmware::script);
|
use base qw(centreon::vmware::script);
|
||||||
|
|
||||||
my $VERSION = '20250501';
|
my $VERSION = '3.4.0';
|
||||||
my %handlers = (TERM => {}, HUP => {}, CHLD => {});
|
my %handlers = (TERM => {}, HUP => {}, CHLD => {});
|
||||||
|
|
||||||
my @load_modules = (
|
my @load_modules = (
|
||||||
|
@ -45,7 +45,7 @@ sub init_response {
|
|||||||
my (%options) = @_;
|
my (%options) = @_;
|
||||||
|
|
||||||
$manager_response->{code} = 0;
|
$manager_response->{code} = 0;
|
||||||
$manager_response->{vmware_connector_version} = '20250501';
|
$manager_response->{vmware_connector_version} = '3.4.0';
|
||||||
$manager_response->{short_message} = 'OK';
|
$manager_response->{short_message} = 'OK';
|
||||||
$manager_response->{extra_message} = '';
|
$manager_response->{extra_message} = '';
|
||||||
$manager_response->{identity} = $options{identity} if (defined($options{identity}));
|
$manager_response->{identity} = $options{identity} if (defined($options{identity}));
|
||||||
|
@ -1,40 +0,0 @@
|
|||||||
name: "centreon-plugins-sudoers"
|
|
||||||
arch: "all"
|
|
||||||
platform: "linux"
|
|
||||||
version_schema: "none"
|
|
||||||
version: "${VERSION}"
|
|
||||||
release: "${RELEASE}${DIST}"
|
|
||||||
section: "default"
|
|
||||||
priority: "optional"
|
|
||||||
maintainer: "Centreon <contact@centreon.com>"
|
|
||||||
description: |
|
|
||||||
Sudoers configuration for centreon plugins
|
|
||||||
Commit: @COMMIT_HASH@
|
|
||||||
vendor: "Centreon"
|
|
||||||
homepage: "https://www.centreon.com"
|
|
||||||
license: "Apache-2.0"
|
|
||||||
|
|
||||||
contents:
|
|
||||||
- src: ./sudoersCentreonPlugins
|
|
||||||
dst: /etc/sudoers.d/centreon-plugins
|
|
||||||
file_info:
|
|
||||||
mode: 0600
|
|
||||||
|
|
||||||
overrides:
|
|
||||||
rpm:
|
|
||||||
provides:
|
|
||||||
- centreon-cwrapper-perl
|
|
||||||
replaces:
|
|
||||||
- centreon-cwrapper-perl
|
|
||||||
depends:
|
|
||||||
- sudo
|
|
||||||
deb:
|
|
||||||
depends:
|
|
||||||
- sudo
|
|
||||||
|
|
||||||
rpm:
|
|
||||||
summary: Sudoers configuration for centreon plugins
|
|
||||||
compression: zstd
|
|
||||||
signature:
|
|
||||||
key_file: ${RPM_SIGNING_KEY_FILE}
|
|
||||||
key_id: ${RPM_SIGNING_KEY_ID}
|
|
@ -1,6 +0,0 @@
|
|||||||
User_Alias CENTREON_COLLECT_USERS=centreon-engine,centreon-gorgone
|
|
||||||
Defaults:CENTREON_COLLECT_USERS !requiretty
|
|
||||||
|
|
||||||
CENTREON_COLLECT_USERS ALL = NOPASSWD: /usr/lib/centreon/plugins/centreon_protocol_dhcp.pl *
|
|
||||||
CENTREON_COLLECT_USERS ALL = NOPASSWD: /usr/lib/centreon/plugins/centreon_protocol_udp.pl *
|
|
||||||
CENTREON_COLLECT_USERS ALL = NOPASSWD: /usr/lib/centreon/plugins/centreon_nmap_cli.pl *
|
|
77
dependencies/perl-crypt-argon2/perl-crypt-argon2.yaml
vendored
Normal file
77
dependencies/perl-crypt-argon2/perl-crypt-argon2.yaml
vendored
Normal file
@ -0,0 +1,77 @@
|
|||||||
|
name: "@NAME@"
|
||||||
|
arch: "${ARCH}"
|
||||||
|
platform: "linux"
|
||||||
|
version_schema: "none"
|
||||||
|
version: "0.020"
|
||||||
|
release: "${RELEASE}${DIST}"
|
||||||
|
section: "default"
|
||||||
|
priority: "optional"
|
||||||
|
maintainer: "Centreon <contact@centreon.com>"
|
||||||
|
description: |
|
||||||
|
This module implements the Argon2 key derivation function, which is suitable to convert any password into a cryptographic key.
|
||||||
|
This is most often used to for secure storage of passwords but can also be used to derive a encryption key from a password.
|
||||||
|
It offers variable time and memory costs as well as output size.
|
||||||
|
Commit: @COMMIT_HASH@
|
||||||
|
vendor: "Centreon"
|
||||||
|
homepage: "https://www.centreon.com"
|
||||||
|
license: "Apache-2.0"
|
||||||
|
|
||||||
|
contents:
|
||||||
|
- src: "/tmp/bin/argon2-calibrate"
|
||||||
|
dst: "/usr/local/bin/"
|
||||||
|
file_info:
|
||||||
|
mode: 0755
|
||||||
|
packager: rpm
|
||||||
|
- src: "/tmp/bin/argon2-calibrate"
|
||||||
|
dst: "/usr/bin/"
|
||||||
|
file_info:
|
||||||
|
mode: 0755
|
||||||
|
packager: deb
|
||||||
|
|
||||||
|
- src: "/tmp/lib/perl5/*/auto/Crypt/Argon2/"
|
||||||
|
dst: "@PERL_VENDORARCH@/auto/Crypt/Argon2/"
|
||||||
|
file_info:
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- src: "/tmp/lib/perl5/*/Crypt/Argon2.pm"
|
||||||
|
dst: "@PERL_VENDORARCH@/Crypt/"
|
||||||
|
file_info:
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
- src: "/tmp/man/man3/Crypt::Argon2*"
|
||||||
|
dst: "/usr/share/man/man3/"
|
||||||
|
file_info:
|
||||||
|
mode: 0644
|
||||||
|
|
||||||
|
overrides:
|
||||||
|
rpm:
|
||||||
|
depends:
|
||||||
|
- perl(Exporter)
|
||||||
|
- perl(Time::HiRes)
|
||||||
|
- perl(XSLoader)
|
||||||
|
- perl(strict)
|
||||||
|
- perl(warnings)
|
||||||
|
conflicts:
|
||||||
|
- perl-Crypt-Argon2-debuginfo
|
||||||
|
replaces:
|
||||||
|
- perl-Crypt-Argon2-debuginfo
|
||||||
|
provides:
|
||||||
|
- perl-Crypt-Argon2-debuginfo
|
||||||
|
- perl(Crypt::Argon2)
|
||||||
|
deb:
|
||||||
|
depends:
|
||||||
|
- perl
|
||||||
|
- libc6
|
||||||
|
conflicts:
|
||||||
|
- libcrypt-argon2-perl-dbgsym
|
||||||
|
replaces:
|
||||||
|
- libcrypt-argon2-perl-dbgsym
|
||||||
|
provides:
|
||||||
|
- libcrypt-argon2-perl-dbgsym
|
||||||
|
|
||||||
|
rpm:
|
||||||
|
summary: Perl interface to the Argon2 key derivation functions
|
||||||
|
compression: zstd
|
||||||
|
signature:
|
||||||
|
key_file: ${RPM_SIGNING_KEY_FILE}
|
||||||
|
key_id: ${RPM_SIGNING_KEY_ID}
|
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