Skip to content

Commit dc4dd91

Browse files
authored
Packaging: Add basic BUILD metadata for rpm/deb packages (#6325)
2 parents 1b81f88 + 2ef489b commit dc4dd91

File tree

2 files changed

+82
-1
lines changed

2 files changed

+82
-1
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Added
7979
to pants' use of PEX lockfiles. This is not a user-facing addition.
8080
#6118 #6141 #6133 #6120 #6181 #6183 #6200 #6237 #6229 #6240 #6241 #6244 #6251 #6253
8181
#6254 #6258 #6259 #6260 #6269 #6275 #6279 #6278 #6282 #6283 #6273 #6287 #6306 #6307
82-
#6311 #6314 #6315 #6317 #6319 #6312 #6320 #6321 #6323 #6324
82+
#6311 #6314 #6315 #6317 #6319 #6312 #6320 #6321 #6323 #6324 #6325
8383
Contributed by @cognifloyd
8484
* Build of ST2 EL9 packages #6153
8585
Contributed by @amanda11

packaging/BUILD

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# Relevant nFPM docs:
2+
# - https://www.pantsbuild.org/stable/reference/targets/nfpm_deb_package
3+
# - https://www.pantsbuild.org/stable/reference/targets/nfpm_rpm_package
4+
# - arch: https://nfpm.goreleaser.com/goarch-to-pkg/
5+
6+
_pkg_description = """
7+
StackStorm Event-driven automation
8+
Package is full standalone st2 installation including all components
9+
in a pre-built venv.
10+
"""
11+
_common_pkg_metadata = dict(
12+
package_name="st2",
13+
description=_pkg_description,
14+
homepage="https://stackstorm.com",
15+
# https://jfearn.fedorapeople.org/en-US/RPM/4/html-single/RPM_Guide/index.html#idp3030720
16+
license="Apache-2.0", # TODO: nFPM is putting this under Copyright tag instead of License
17+
version="", # injected by pants-plugins/release
18+
# arch used to be "any", but that was not correct as the venv has compiled packages.
19+
arch="amd64", # NOTE: parametrize this if adding support for arm64 or other arch.
20+
platform="linux",
21+
)
22+
_maintainer = "StackStorm Engineering <opsadmin@stackstorm.com>" # TODO: update this
23+
24+
25+
def _distro(distro_id: str, **kwargs):
26+
return parametrize(
27+
distro_id,
28+
distro_id=distro_id,
29+
**kwargs,
30+
)
31+
32+
33+
nfpm_deb_package(
34+
name="st2.deb",
35+
dependencies=[
36+
"./deb/scripts",
37+
],
38+
scripts=dict(
39+
preinstall="deb/scripts/pre-install.sh",
40+
postinstall="deb/scripts/post-install.sh",
41+
preremove="deb/scripts/pre-remove.sh",
42+
postremove="deb/scripts/post-remove.sh",
43+
# config="",
44+
# templates="",
45+
# rules="",
46+
),
47+
maintainer=_maintainer,
48+
fields={
49+
# https://www.debian.org/doc/debian-policy/ch-controlfields.html#source
50+
# We do not have an "st2" source package, so do not include "Source".
51+
# https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-vcs-fields
52+
"Vcs-Git": "git://github.com/stackstorm/st2.git",
53+
"Vcs-Browser": "https://github.com/stackstorm/st2",
54+
},
55+
section="python",
56+
priority="optional",
57+
**_common_pkg_metadata,
58+
**_distro("focal"),
59+
)
60+
61+
nfpm_rpm_package(
62+
name="st2.rpm",
63+
dependencies=[
64+
"./rpm/scripts",
65+
],
66+
scripts=dict(
67+
preinstall="rpm/scripts/pre-install.sh",
68+
postinstall="rpm/scripts/post-install.sh",
69+
preremove="rpm/scripts/pre-remove.sh",
70+
postremove="rpm/scripts/post-remove.sh",
71+
# pretrans="",
72+
# posttrans="",
73+
# verify="",
74+
),
75+
vendor="The StackStorm Project",
76+
packager=_maintainer,
77+
# group="System/Management", # was only useful for EL 5 and earlier
78+
**_common_pkg_metadata,
79+
**_distro("el8", compression="xz"),
80+
**_distro("el9", compression="zstd:default"),
81+
)

0 commit comments

Comments
 (0)