Run automatic pre and post migration scripts #813
Notifications
Due Date
No due date set.
Blocks
#811 abra app upgrade stability
toolshed/abra
Reference: toolshed/abra#813
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Thanks Tobias Featherbutt for starting the discussion and for the great problem and solution statements
Problem:
I have to do manual steps when upgrading a recipe like:
Solution:
Allow writing pre and post scripts in
abra.sh. This way they could also be run manually (for example during testing).Each upgrade can have up to four scripts, which are executed in the order as given here:
upgrade_<version>_pre_local:Execute before actual upgrade locally
Equivalent abra command:
abra app cmd example.com upgrade_1.0.0+1.0.0_pre_local --localupgrade_<version>_post_<service>Execute after actual upgrade in the given
Equivalent abra command:
abra app cmd example.com app upgrade_1.0.0+1.0.0_post_appupgrade_<version>_post_localExecute after actual upgrade locally
Equivalent abra command:
abra app cmd example.com app upgrade_1.0.0+1.0.0_post --localUsing next instead
<version>It is possible to use function names with out the actual version but instead with "next". When running abra recupe release
allnext` upgrade functions will be coverted to functions. This is the same logic as with release notesRelated:
Should we create a wiki page somewhere and start to note what kind of events people want to be able to subscribe to, where they could be found?
For this specific proposition, can @p4u1 give some pros and cons between:
upgrade_pre_localscript?To me the second is more versatile, specifically if you want to pass
from_versionandto_version, which would give a lot of scripts...@ineiti can you give a use case for 2? Also would it still be possible to name the version next and let Abra insert the actual version? I'm not strictly against the more generic entrypoint but still need to be convinced :)
Maybe create a pad and then we can collaborate there?
We are doing this with alakazam, see here
We have hooks for
For example, the stuff we tell Nextcloud to do:
08e9f8ad9f/alaka-defaults.yml (L58-L71)So we just write abra.sh functions and in our alaka-config, the syntax is
<container> <function> <arguments>A usecase for the secret-hook is vaultwarden or kimai
That way we also can run those manually again whenever needed. Works very reliable for us. Having more pre-hooks e.g. to check the Nextcloud apps would be nice though!