Skip to content

Commit 17e588f

Browse files
systemd_exporter rpm
1 parent 50c70a9 commit 17e588f

2 files changed

Lines changed: 50 additions & 4 deletions

File tree

.github/workflows/prometheus2_rpm.yml

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Prometheus2 EL10 RPM
1+
name: Build Prometheus2 and Systemd Exporter EL10 RPM
22

33
on:
44
push:
@@ -16,8 +16,8 @@ on:
1616
default: true
1717

1818
jobs:
19-
build-rpm:
20-
name: Build RPM for EL10
19+
build-prometheus2-rpm:
20+
name: Build Prometheus2 RPM for EL10
2121
runs-on: ubuntu-latest
2222
steps:
2323
- name: Checkout source
@@ -57,3 +57,44 @@ jobs:
5757
draft: ${{ inputs.draft }}
5858
files: _dist10_RPM/*.rpm
5959

60+
build-systemd_exporter-rpm:
61+
name: Build Systemd Exporter RPM for EL10
62+
runs-on: ubuntu-latest
63+
steps:
64+
- name: Checkout source
65+
uses: actions/checkout@v4
66+
67+
- name: Install Deps
68+
run: |
69+
sudo apt-get update
70+
sudo apt-get install -y make
71+
72+
- name: Build Rocky10 Docker Image
73+
run: make build-rocky10-image
74+
75+
- name: Build Systemd Exporter RPM
76+
run: make build10-systemd_exporter
77+
78+
- name: Upload Binary RPM
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: systemd_exporter-el10-rpm
82+
path: _dist10_RPM/*.rpm
83+
if-no-files-found: error
84+
85+
- name: Upload Source RPM
86+
uses: actions/upload-artifact@v4
87+
with:
88+
name: systemd_exporter-el10-srpm
89+
path: _dist10_SRPM/*.rpm
90+
if-no-files-found: error
91+
92+
- name: Create GitHub Release
93+
if: github.event_name == 'workflow_dispatch' && inputs.release_name != ''
94+
uses: softprops/action-gh-release@v2
95+
with:
96+
tag_name: ${{ inputs.release_name }}
97+
name: ${{ inputs.release_name }}
98+
draft: ${{ inputs.draft }}
99+
files: _dist10_RPM/*.rpm
100+

Makefile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
MANUAL = prometheus2 \
2+
systemd_exporter \
23
thanos \
34
jmx_exporter \
45
rabbitmq_exporter \
@@ -84,6 +85,10 @@ build-rocky10-image:
8485

8586
$(addprefix build10-,$(MANUAL)): build-rocky10-image
8687
$(eval PACKAGE=$(subst build10-,,$@))
88+
# If the package is prometheus2, use the prometheus2.spec file, otherwise use the autogen_${PACKAGE}.spec file
89+
$(eval SPEC_FILE=$(if $(filter prometheus2,$(PACKAGE)),${PACKAGE}.spec,autogen_${PACKAGE}.spec))
90+
$(if $(filter prometheus2,$(PACKAGE)),,python3 ./generate.py --templates ${PACKAGE})
91+
8792
[ -d ${PWD}/_dist10_RPM ] || mkdir ${PWD}/_dist10_RPM
8893
[ -d ${PWD}/_dist10_SRPM ] || mkdir ${PWD}/_dist10_SRPM
8994
[ -d ${PWD}/_cache_dnf ] || mkdir ${PWD}/_cache_dnf
@@ -94,7 +99,7 @@ $(addprefix build10-,$(MANUAL)): build-rocky10-image
9499
-v ${PWD}/_dist10_SRPM:/rpmbuild/SRPMS/ \
95100
-v ${PWD}/_cache_dnf:/var/cache/dnf \
96101
rocky10-rpm-builder:latest \
97-
build-spec SOURCES/${PACKAGE}.spec
102+
build-spec SOURCES/${SPEC_FILE}
98103

99104
$(addprefix build9-,$(MANUAL)):
100105
$(eval PACKAGE=$(subst build9-,,$@))

0 commit comments

Comments
 (0)