-
Notifications
You must be signed in to change notification settings - Fork 279
152 lines (129 loc) · 4.78 KB
/
nrpe.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
name: nrpe
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
on:
workflow_dispatch:
pull_request:
paths:
- 'nrpe/packaging/**'
push:
branches:
- develop
- master
paths:
- 'nrpe/packaging/**'
jobs:
get-environment:
uses: ./.github/workflows/get-environment.yml
with:
version_file: nrpe/packaging/centreon-nrpe3-daemon.yaml
package:
needs: [get-environment]
runs-on: ubuntu-22.04
strategy:
fail-fast: false
matrix:
include:
- package_extension: rpm
image: packaging-plugins-alma8
distrib: el8
- package_extension: rpm
image: packaging-plugins-alma9
distrib: el9
- package_extension: deb
image: packaging-plugins-bullseye
distrib: bullseye
container:
image: ${{ vars.DOCKER_INTERNAL_REGISTRY_URL }}/${{ matrix.image }}
credentials:
username: ${{ secrets.DOCKER_REGISTRY_ID }}
password: ${{ secrets.DOCKER_REGISTRY_PASSWD }}
name: package ${{ matrix.distrib }}
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Download nrpe sources
run: |
curl -Lo - "https://github.com/NagiosEnterprises/nrpe/releases/download/nrpe-${{ needs.get-environment.outputs.version }}/nrpe-${{ needs.get-environment.outputs.version }}.tar.gz" | tar zxpf -
mv nrpe-${{ needs.get-environment.outputs.version }} nrpe-src
shell: bash
- name: Compile sources
run: |
cd nrpe-src
patch -p1 < ../nrpe/packaging/files/nrpe3_add_centreon_cmd.patch
if [ "${{ matrix.package_extension }}" = "deb" ]; then
NAGIOS_PLUGINS_PATH="/usr/lib/nagios/plugins"
else
NAGIOS_PLUGINS_PATH="/usr/lib64/nagios/plugins"
fi
CXXFLAGS="-Wall -Wextra" ./configure \
--libexecdir="$NAGIOS_PLUGINS_PATH" \
--localstatedir="/var/log/nrpe" \
--sysconfdir="/etc/nrpe" \
--enable-command-args \
--with-nrpe-user="centreon-engine" \
--with-nrpe-group="centreon-engine" \
--with-nrpe-port="5666" \
--with-nagios-user="centreon-engine" \
--with-nagios-group="centreon-engine"
make all
shell: bash
- name: Generate debug files
run: |
cd nrpe-src/src
for file in "nrpe" "check_nrpe"; do
objcopy --only-keep-debug $file $file.debug
objcopy --strip-debug $file
objcopy --add-gnu-debuglink $file.debug $file
done
shell: bash
- name: Package
uses: ./.github/actions/package
with:
nfpm_file_pattern: "nrpe/packaging/*.yaml"
distrib: ${{ matrix.distrib }}
package_extension: ${{ matrix.package_extension }}
version: ${{ needs.get-environment.outputs.version }}
release: ${{ needs.get-environment.outputs.release }}
commit_hash: ${{ github.sha }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-${{ matrix.package_extension }}-${{ matrix.distrib }}
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 }}
deliver-rpm:
needs: [get-environment, package]
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [el8, el9]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Delivery
uses: ./.github/actions/rpm-delivery
with:
module_name: nrpe
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-rpm-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}
deliver-deb:
needs: [get-environment ,package]
if: ${{ contains(fromJson('["stable", "testing", "unstable"]'), needs.get-environment.outputs.stability) }}
runs-on: [self-hosted, common]
strategy:
matrix:
distrib: [bullseye]
steps:
- name: Checkout sources
uses: actions/checkout@v4
- name: Delivery
uses: ./.github/actions/deb-delivery
with:
module_name: nrpe
distrib: ${{ matrix.distrib }}
cache_key: ${{ github.sha }}-${{ github.run_id }}-deb-${{ matrix.distrib }}
stability: ${{ needs.get-environment.outputs.stability }}
artifactory_token: ${{ secrets.ARTIFACTORY_ACCESS_TOKEN }}