Skip to content

Commit b0fe4dc

Browse files
committed
Packit update for downstream build
Signed-off-by: Navid Yaghoobi <navidys@fedoraproject.org>
1 parent 8ac298f commit b0fe4dc

7 files changed

Lines changed: 227 additions & 357 deletions

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,9 @@ bin/
55
*.log
66
*.out
77
ize
8+
*.zip
9+
*.tar.gz
10+
*.tar
11+
*.srpm
12+
*.rpm
13+
prepare_sources_result/

.packit.sh

Lines changed: 0 additions & 31 deletions
This file was deleted.

.packit.yaml

Lines changed: 72 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,92 @@
11
# See the documentation for more information:
22
# https://packit.dev/docs/configuration/
33

4-
specfile_path: prometheus-podman-exporter.spec
4+
downstream_package_name: prometheus-podman-exporter
5+
upstream_tag_template: v{version}
6+
7+
srpm_build_deps:
8+
- git-archive-all
9+
10+
packages:
11+
exporter-fedora:
12+
pkg_tool: fedpkg
13+
specfile_path: rpm/prometheus-podman-exporter.spec
14+
15+
exporter-centos:
16+
pkg_tool: centpkg
17+
specfile_path: rpm/prometheus-podman-exporter.spec
18+
19+
merge_pr_in_ci: false
20+
21+
files_to_sync:
22+
- src:
23+
- ".packit.yaml"
24+
- "rpm/prometheus-podman-exporter.spec"
25+
- "rpm/vendor-*.tar.gz"
26+
dest: .
27+
28+
actions:
29+
fix-spec-file:
30+
- "bash rpm/packit-copr-rpm.sh"
31+
post-modifications:
32+
- |
33+
bash -xc '
34+
export CURRENT_DIR=$(pwd)
35+
export BASE_DIR=${PACKIT_UPSTREAM_REPO}/
36+
if [ -n "${PACKIT_DOWNSTREAM_REPO}" ] ; then
37+
VERSION=$(grep -E "^VERSION=" ${BASE_DIR}/VERSION | cut -d= -f2)
38+
tar -C ${BASE_DIR} -czf "vendor-${VERSION}.tar.gz" vendor/
39+
cp vendor-${VERSION}.tar.gz ${PACKIT_DOWNSTREAM_REPO}
40+
fi
41+
'
542
643
jobs:
744
- job: copr_build
845
trigger: pull_request
946
enable_net: true
10-
srpm_build_deps:
11-
- make
12-
- openssl-devel
13-
- rpkg
47+
packages: [exporter-fedora]
1448
targets:
1549
- fedora-all-x86_64
1650
- fedora-all-aarch64
17-
# go1.24.7 rpm not available yet for ELEP9
18-
# - epel-9-x86_64
19-
# - epel-9-aarch64
51+
52+
- job: copr_build
53+
trigger: pull_request
54+
enable_net: true
55+
packages: [exporter-fedora]
56+
targets:
57+
- epel-9-x86_64
58+
- epel-9-aarch64
2059
- epel-10-x86_64
2160
- epel-10-aarch64
61+
62+
- job: copr_build
63+
trigger: pull_request
64+
enable_net: true
65+
packages: [exporter-centos]
66+
targets:
2267
- centos-stream-9-x86_64
2368
- centos-stream-9-aarch64
2469
- centos-stream-10-x86_64
2570
- centos-stream-10-aarch64
2671

72+
- job: propose_downstream
73+
trigger: release
74+
update_release: false
75+
packages:
76+
- exporter-fedora
77+
dist_git_branches: &build_targets
78+
- fedora-all
79+
- epel-9
80+
- epel-10
2781

28-
actions:
29-
post-upstream-clone:
30-
- "rpkg spec --outdir ./"
82+
- job: koji_build
83+
trigger: commit
84+
packages:
85+
- exporter-fedora
86+
dist_git_branches: *build_targets
3187

32-
fix-spec-file:
33-
"bash .packit.sh"
88+
- job: bodhi_update
89+
trigger: koji_build
90+
packages:
91+
- exporter-fedora
92+
dist_git_branches: *build_targets

Makefile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ VERSION = $(shell cat VERSION | grep VERSION | cut -d'=' -f2)
1919
REVISION = $(shell cat VERSION | grep REVISION | cut -d'=' -f2)
2020
BRANCH=$(shell git rev-parse --abbrev-ref HEAD 2>/dev/null)
2121

22+
PACKIT_RPM := ./rpm
23+
PACKIT_PREP = ./prepare_sources_result
24+
2225
#=================================================
2326
# Build binary, clean, install and uninstall
2427
#=================================================
@@ -28,6 +31,11 @@ all: binary
2831
.PHONY: clean
2932
clean:
3033
@rm -rf $(BIN)
34+
@rm -rf $(PACKIT_PREP)
35+
@rm -rf $(PACKIT_RPM)/*.tar.gz
36+
@rm -rf *.tar.gz
37+
@rm -rf *.rpm
38+
@rm -rf *.tar
3139

3240
.PHONY: binary
3341
binary: $(TARGET) ## Build prometheus-podman-exporter binary

0 commit comments

Comments
 (0)