Packaging: Add conf files to deb/rpm packages #6330
Merged
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.
Previous PRs in this series:
nfpm_deb_packageandnfpm_rpm_package) was added in Packaging: Add basic BUILD metadata for rpm/deb packages #6325 along with the deb maintainer scripts and rpm scriptlets.pex_binary(needed for this PR)This PR focuses on adding the conf files installed by this st2-packages.git Makefile:
https://github.com/StackStorm/st2-packages/blob/d4d2d8dfdf1c88412e5d58635adb87da9c671952/packages/st2/Makefile#L66-L104
shell_commandtargetsFor the most part, adding the conf files to deb/rpm packages is fairly straightforward. But, in a few cases, the old Makefile made changes to the files on the fly. So, this PR adds
shell_commandBUILD targets to make those edits./etc/st2/htpasswdThe
/etc/st2/htpasswdfile was generated on the fly like this:I used
touchto do effectively the same thing with a shell_command.st2/conf/BUILD
Lines 61 to 67 in ae649f9
/etc/st2/st2.confThe
/etc/st2/conffile hadvirtualenv_optsmodified on the fly like this:I used crudini to do something similar with a
shell_command.st2/conf/BUILD
Lines 69 to 76 in ae649f9
To simplify, I make this modification for all OSes. If any of them fail when we test the built packages, we can revisit making this OS-specific. Here are some historical references about the os-specific virtualenv_opts:
/etc/st2/logging.*confand/etc/st2/syslog.*confThe logging conf files were modified to change the log directory and the default log level like this:
This PR uses a portable
sedcommand to make the log directory change, and uses crudini to change the log level in a reliable and portable way:st2/pants-plugins/macros.py
Lines 234 to 247 in ae649f9
This
shell_commandis in a newst2_logging_conf_for_nfpmmacro so that it was fairly simple to run it on all the logging conf files.