Skip to content

Commit 49f7eff

Browse files
Merge pull request #4 from whamcloud/pgarg/systemd_exporter_rpm
systemd_exporter rpm
2 parents 50c70a9 + 4790626 commit 49f7eff

2 files changed

Lines changed: 92 additions & 4 deletions

File tree

.github/workflows/prometheus2_rpm.yml

Lines changed: 85 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build Prometheus2 EL10 RPM
1+
name: Build EL10 RPMs
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,85 @@ 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+
101+
build-node_exporter-rpm:
102+
name: Build Node Exporter RPM for EL10
103+
runs-on: ubuntu-latest
104+
steps:
105+
- name: Checkout source
106+
uses: actions/checkout@v4
107+
108+
- name: Install Deps
109+
run: |
110+
sudo apt-get update
111+
sudo apt-get install -y make
112+
113+
- name: Build Rocky10 Docker Image
114+
run: make build-rocky10-image
115+
116+
- name: Build Node Exporter RPM
117+
run: make build10-node_exporter
118+
119+
- name: Upload Binary RPM
120+
uses: actions/upload-artifact@v4
121+
with:
122+
name: node_exporter-el10-rpm
123+
path: _dist10_RPM/*.rpm
124+
if-no-files-found: error
125+
126+
- name: Upload Source RPM
127+
uses: actions/upload-artifact@v4
128+
with:
129+
name: node_exporter-el10-srpm
130+
path: _dist10_SRPM/*.rpm
131+
if-no-files-found: error
132+
133+
- name: Create GitHub Release
134+
if: github.event_name == 'workflow_dispatch' && inputs.release_name != ''
135+
uses: softprops/action-gh-release@v2
136+
with:
137+
tag_name: ${{ inputs.release_name }}
138+
name: ${{ inputs.release_name }}
139+
draft: ${{ inputs.draft }}
140+
files: _dist10_RPM/*.rpm
141+

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
MANUAL = prometheus2 \
2+
systemd_exporter \
3+
node_exporter \
24
thanos \
35
jmx_exporter \
46
rabbitmq_exporter \
@@ -84,6 +86,10 @@ build-rocky10-image:
8486

8587
$(addprefix build10-,$(MANUAL)): build-rocky10-image
8688
$(eval PACKAGE=$(subst build10-,,$@))
89+
# If the package is prometheus2, use the prometheus2.spec file, otherwise use the autogen_${PACKAGE}.spec file
90+
$(eval SPEC_FILE=$(if $(filter prometheus2,$(PACKAGE)),${PACKAGE}.spec,autogen_${PACKAGE}.spec))
91+
$(if $(filter prometheus2,$(PACKAGE)),,python3 ./generate.py --templates ${PACKAGE})
92+
8793
[ -d ${PWD}/_dist10_RPM ] || mkdir ${PWD}/_dist10_RPM
8894
[ -d ${PWD}/_dist10_SRPM ] || mkdir ${PWD}/_dist10_SRPM
8995
[ -d ${PWD}/_cache_dnf ] || mkdir ${PWD}/_cache_dnf
@@ -94,7 +100,7 @@ $(addprefix build10-,$(MANUAL)): build-rocky10-image
94100
-v ${PWD}/_dist10_SRPM:/rpmbuild/SRPMS/ \
95101
-v ${PWD}/_cache_dnf:/var/cache/dnf \
96102
rocky10-rpm-builder:latest \
97-
build-spec SOURCES/${PACKAGE}.spec
103+
build-spec SOURCES/${SPEC_FILE}
98104

99105
$(addprefix build9-,$(MANUAL)):
100106
$(eval PACKAGE=$(subst build9-,,$@))

0 commit comments

Comments
 (0)