Univention Bugzilla – Bug 51790
Execute custom hook scripts after app install/update/remove
Last modified: 2020-09-14 12:42:15 CEST
In order to automate several repeating administrative tasks this feature was requested.
A first solution can be found in commit d9ad58e8cd and is ready for QA. Thanks to everyone!
Package: ucs-test Version: 9.0.4-35A~4.4.0.202008081905 Branch: ucs_4.4-0 Scope: errata4.4-5 User: jbremer Successful build Package: univention-appcenter Version: 8.0.11-133A~4.4.0.202008072223 Branch: ucs_4.4-0 Scope: errata4.4-5 User: jbremer --------------------------- What I tested: Hook scripts get executed on: install : OK upgrade : OK remove : OK Code review: OK Docu: Easy to follow and to understand: OK Test case: I made some changes because some imports were missing and the test failed on upgrade: ea76aad99c Bug #51790: 69_app_install_update_remove_hooks - fix error on upgrade d4209f7d45 Bug #51790: Test-case: Fix indentation, import error and example hook files. I also added the advisory: 3e598b8ce4 Bug #51690: yaml ------------------------------ TODO: Wait for nightly test result and final QA from someone who knows the appcenter well.
* please use run-parts for the hook-directory * rename call_all_hooks to call_post_hooks, maybe we add other hooks in the future * remove the line from subprocess import call # `call` with python3.5 should be replaced with `run` ("call" is unused) * you added "_call_all_hooks" to the base class, isn't it now the case that the hook is called for every action, not just install/remove/upgrade?
REOPEN: management/univention-appcenter/python/appcenter/actions/install_base.py|194 col 16 error| undefined name 'action' [F821]
Changes integrated in 4cee03d480 (after a revert of the previous version)
Hook scripts are executed after install/upgrade/remove action: OK Test: FAIL ucs-test was not built since the addition of the new test case. The test has not been run in jenkins for that reason. Executing the test manually leads to File "69_app_install_update_remove_hooks_orig", line 83 with app as App( SyntaxError: can't assign to function call so the test needs to be fixed and ucs-test should be built. Documentation: FAIL Since run-parts is used, only files with certain names are executed. E.g test.sh will not be executed. This should be well documented and/or a warning should be displayed/logged. -> reopen
[4.4-5] bff63ba6e3 Bug #51790 doc: Fix spelling mistakes doc/manual/software-de.xml | 14 +++++++------- doc/manual/software-en.xml | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) Please check for spelling mistakes too next time: <https://hutten.knut.univention.de/mediawiki/index.php/Docbook#Rechtschreibpr.C3.BCfung> Please use a separate branch as this change blocks other changes now: <https://jenkins.knut.univention.de:8181/view/Doku/job/BuildDocBookBranch/>
product: ucs release: "4.4" version: [5] scope: ucs_4.4-0-errata4.4-5 src: ucs-test fix: 9.0.4-50A~4.4.5.202009011049 @Philipp: Further improved documentation, used the docker image for spell checks. Works great. Thanks!
Please add something like this to the documentation Die Skripte müssen ausführbar sein und werden über "run-parts" gestartet (Dateinamen dürfen nur aus Kleinbuchst ...)
@Felix: done.
Fixed test description and made the calling logic for script hooks more generic after a qa suggestion. Thanks to Felix. Latest version is now: ucs-test: 9.0.4-51A~4.4.5.202009011518 univention-appcenter: 8.0.11-136A~4.4.5.202009011518
OK - univention-appcenter (hooks) OK - yaml OK - documentation OK - test TODO - Jenkins
OK - Jenkins
<https://errata.software-univention.de/#/?erratum=4.4x735>