Packaging: Add distro_id
field to nfpm_deb_package
and nfpm_rpm_package
targets
#6324
+60
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is working towards doing packaging via pantsbuild. Eventually, I hope to archive and stop using st2-packages.git.
This is a follow-up to #6323, resolving the TODO explained in #6323 (comment).
In
pants-plugins/release
, a newdistro_id
field is defined here:st2/pants-plugins/release/target_types.py
Lines 22 to 24 in 00ff205
This field basically accepts an enum of
valid_choices
. Thesevalid_choices
should be a list of supported or soon-to-be-supported distros:st2/pants-plugins/release/target_types.py
Lines 25 to 33 in 00ff205
And mark the field as
required
so that all BUILD targets have this field defined (if the field is registered for that target).st2/pants-plugins/release/target_types.py
Line 34 in 00ff205
This registers the new field on the
nfpm_deb_package
andnfpm_rpm_package
targets:st2/pants-plugins/release/target_types.py
Lines 48 to 52 in 00ff205
To finish the field registration, the field rules get added to
pants-plugins/release/register.py
:st2/pants-plugins/release/register.py
Lines 19 to 27 in 00ff205
Finally, replace the TODO with the value of the
distro_id
field here:st2/pants-plugins/release/rules.py
Line 244 in 00ff205