-
-
Notifications
You must be signed in to change notification settings - Fork 779
Packaging: Add basic BUILD metadata for rpm/deb packages #6325
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
a067617
02ea550
403b3ce
b7a4540
2ef489b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,81 @@ | ||||||
| # Relevant nFPM docs: | ||||||
| # - https://www.pantsbuild.org/stable/reference/targets/nfpm_deb_package | ||||||
| # - https://www.pantsbuild.org/stable/reference/targets/nfpm_rpm_package | ||||||
| # - arch: https://nfpm.goreleaser.com/goarch-to-pkg/ | ||||||
|
|
||||||
| _pkg_description = """ | ||||||
| StackStorm Event-driven automation | ||||||
| Package is full standalone st2 installation including all components | ||||||
| in a pre-built venv. | ||||||
| """ | ||||||
| _common_pkg_metadata = dict( | ||||||
| package_name="st2", | ||||||
| description=_pkg_description, | ||||||
| homepage="https://stackstorm.com", | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From:
See: |
||||||
| # https://jfearn.fedorapeople.org/en-US/RPM/4/html-single/RPM_Guide/index.html#idp3030720 | ||||||
| license="Apache-2.0", # TODO: nFPM is putting this under Copyright tag instead of License | ||||||
|
Comment on lines
+15
to
+16
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From:
See: |
||||||
| version="", # injected by pants-plugins/release | ||||||
| # arch used to be "any", but that was not correct as the venv has compiled packages. | ||||||
| arch="amd64", # NOTE: parametrize this if adding support for arm64 or other arch. | ||||||
|
Comment on lines
+18
to
+19
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From:
Also, this uses the See: |
||||||
| platform="linux", | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just needed for nfpm. I included it here to be explicit instead of relying on the default value See: |
||||||
| ) | ||||||
| _maintainer = "StackStorm Engineering <opsadmin@stackstorm.com>" # TODO: update this | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From:
I don't think that is the best name/email to use here, but I just copied it for now. Maybe it should be:
Suggested change
See: |
||||||
|
|
||||||
|
|
||||||
| def _distro(distro_id: str, **kwargs): | ||||||
| return parametrize( | ||||||
| distro_id, | ||||||
| distro_id=distro_id, | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here's the distro_id field added in #6324. |
||||||
| **kwargs, | ||||||
| ) | ||||||
|
|
||||||
|
|
||||||
| nfpm_deb_package( | ||||||
| name="st2.deb", | ||||||
| dependencies=[ | ||||||
| "./deb/scripts", | ||||||
| ], | ||||||
| scripts=dict( | ||||||
| preinstall="deb/scripts/pre-install.sh", | ||||||
| postinstall="deb/scripts/post-install.sh", | ||||||
| preremove="deb/scripts/pre-remove.sh", | ||||||
| postremove="deb/scripts/post-remove.sh", | ||||||
| # config="", | ||||||
| # templates="", | ||||||
| # rules="", | ||||||
| ), | ||||||
| maintainer=_maintainer, | ||||||
| fields={ | ||||||
| # https://www.debian.org/doc/debian-policy/ch-controlfields.html#source | ||||||
| # We do not have an "st2" source package, so do not include "Source". | ||||||
|
Comment on lines
+49
to
+50
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. From (deb): https://github.com/StackStorm/st2-packages/blob/d4d2d8dfdf1c88412e5d58635adb87da9c671952/packages/st2/debian/control#L1 |
||||||
| # https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-vcs-fields | ||||||
| "Vcs-Git": "git://github.com/stackstorm/st2.git", | ||||||
| "Vcs-Browser": "https://github.com/stackstorm/st2", | ||||||
|
Comment on lines
+51
to
+53
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These get included in the debian control file. See: https://www.pantsbuild.org/stable/reference/targets/nfpm_deb_package#fields |
||||||
| }, | ||||||
| section="python", | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| priority="optional", | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||||||
| **_common_pkg_metadata, | ||||||
| **_distro("focal"), | ||||||
| ) | ||||||
|
|
||||||
| nfpm_rpm_package( | ||||||
| name="st2.rpm", | ||||||
| dependencies=[ | ||||||
| "./rpm/scripts", | ||||||
| ], | ||||||
| scripts=dict( | ||||||
| preinstall="rpm/scripts/pre-install.sh", | ||||||
| postinstall="rpm/scripts/post-install.sh", | ||||||
| preremove="rpm/scripts/pre-remove.sh", | ||||||
| postremove="rpm/scripts/post-remove.sh", | ||||||
| # pretrans="", | ||||||
| # posttrans="", | ||||||
| # verify="", | ||||||
| ), | ||||||
| vendor="The StackStorm Project", | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is new. It was not in st2-packages.git. It is not used in Fedora, so we don't have to include it. See: https://www.pantsbuild.org/stable/reference/targets/nfpm_rpm_package#vendor |
||||||
| packager=_maintainer, | ||||||
| # group="System/Management", # was only useful for EL 5 and earlier | ||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We no longer support EL 5 or earlier, so we should probably just drop this line instead of commenting it out. Right?
Suggested change
See: https://www.pantsbuild.org/stable/reference/targets/nfpm_rpm_package#group |
||||||
| **_common_pkg_metadata, | ||||||
| **_distro("el8", compression="xz"), | ||||||
| **_distro("el9", compression="zstd:default"), | ||||||
| ) | ||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From:
See:
Also, the first line of the description is used for summary: