diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 49ecc1744c..b2e24e4508 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -79,7 +79,7 @@ Added to pants' use of PEX lockfiles. This is not a user-facing addition. #6118 #6141 #6133 #6120 #6181 #6183 #6200 #6237 #6229 #6240 #6241 #6244 #6251 #6253 #6254 #6258 #6259 #6260 #6269 #6275 #6279 #6278 #6282 #6283 #6273 #6287 #6306 #6307 - #6311 #6314 #6315 #6317 #6319 #6312 + #6311 #6314 #6315 #6317 #6319 #6312 #6320 Contributed by @cognifloyd * Build of ST2 EL9 packages #6153 Contributed by @amanda11 diff --git a/packaging/deb/scripts/post-install.sh b/packaging/deb/scripts/post-install.sh index 539fe027ef..27bb66a7e0 100644 --- a/packaging/deb/scripts/post-install.sh +++ b/packaging/deb/scripts/post-install.sh @@ -29,6 +29,15 @@ set -e # https://www.mankier.com/5/deb-triggers # https://stackoverflow.com/questions/15276535/dpkg-how-to-use-trigger +# The default set of packs installed with st2. +_ST2_PACKS=" +chatops +core +default +linux +packs +" + # This must include ".service" to satisfy deb-systemd-{helper,invoke} _ST2_SERVICES=" st2actionrunner.service @@ -83,8 +92,26 @@ systemd_enable_and_restart() { fi } +rebuild_st2_venv() { + /opt/stackstorm/install/st2.pex +} + +extract_st2_pack() { + pack=${1} + shift + # shellcheck disable=SC2209 + PAGER=cat /opt/stackstorm/install/packs/"${pack}".tgz.run --quiet --accept "${@}" +} + case "$1" in configure) + # Fail install if venv build or pack extraction fails + rebuild_st2_venv || exit $? + for pack in ${_ST2_PACKS}; do + extract_st2_pack "${pack}" || exit $? + done + extract_st2_pack examples --target /usr/share/doc/st2/examples || : + # shellcheck disable=SC2086 systemd_enable_and_restart ${_ST2_SERVICES} ;; diff --git a/packaging/rpm/scripts/post-install.sh b/packaging/rpm/scripts/post-install.sh index 264dd0616f..a7909c3f18 100644 --- a/packaging/rpm/scripts/post-install.sh +++ b/packaging/rpm/scripts/post-install.sh @@ -7,6 +7,15 @@ set -e # * on upgrade: $1 > 1 # https://docs.fedoraproject.org/en-US/packaging-guidelines/Scriptlets/#_syntax +# The default set of packs installed with st2. +_ST2_PACKS=" +chatops +core +default +linux +packs +" + _ST2_SERVICES=" st2actionrunner st2api @@ -21,6 +30,24 @@ st2timersengine st2workflowengine " +rebuild_st2_venv() { + /opt/stackstorm/install/st2.pex +} + +extract_st2_pack() { + pack=${1} + shift + # shellcheck disable=SC2209 + PAGER=cat /opt/stackstorm/install/packs/"${pack}".tgz.run --quiet --accept "${@}" +} + +# Fail install if venv build or pack extraction fails +rebuild_st2_venv || exit $? +for pack in ${_ST2_PACKS}; do + extract_st2_pack "${pack}" || exit $? +done +extract_st2_pack examples --target /usr/share/doc/st2/examples || : + # Native .rpm specs use macros that get expanded into shell snippets. # We are using nfpm, so we inline the macro expansion here. # %systemd_post