Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pre-start migration script for Stirling PDF updates #1864

Conversation

sharknoon
Copy link
Contributor

This PR is a follow-up for this PR: #1861

I have added a pre-start hook to update to 0.28.3 first, if the installed version is < 0.28.0.

A couple of notes from my side:

  • I have tried reproducing the upgrade error (upgrading straigt from 0.25.0 to 0.34.0 without hook), but to my suprise that worked wonderfully
  • Stirling PDF seems to not store their version in any persisted files, so I get the version from the image label org.opencontainers.image.version
  • I don't know exactly how to test this hook. I have copied it into the appstore directory and ran umbreld client apps.update.mutate --appId stirling-pdf, which worked, but I am not sure, if the script execution was successful. I am also not sure where to find the echo logs

@nmfretz If you have time, can you help me test this hook? That would be a great help :) Thank you!

@sharknoon
Copy link
Contributor Author

Regarding your Question: No, they don't store any important data, just some preferences
grafik
I think maybe it is easier, as you suggested, to just add this note, because 1. probably most of the users have installed the updates for Stirling PDF and 2. even if they didn't, they would not loose any important data

@nmfretz
Copy link
Contributor

nmfretz commented Nov 28, 2024

I think maybe it is easier, as you suggested, to just add this note, because 1. probably most of the users have installed the updates for Stirling PDF and 2. even if they didn't, they would not loose any important data

Ya, I'm really leaning this way now especially since it's just some minor preferences that would be lost. I think the tradeoff is worth it to keep this super clean... I'm pretty sure no one is going to be impacted at all. But if they are the consequences are pretty inconsequential (just re-install with no data loss). Let's go with a warning in the release notes as discussed here #1861

I don't know exactly how to test this hook. I have copied it into the appstore directory and ran umbreld client apps.update.mutate --appId stirling-pdf, which worked, but I am not sure, if the script execution was successful. I am also not sure where to find the echo logs

Nice job on the hook with grabbing the version and waiting for stirling to be up and running 👌.

You can stream the logs while updating with:

sudo journalctl -u umbrel -f

Or if you want to just have one terminal open you can do:

umbreld client apps.update.mutate --appId stirling-pdf & sudo journalctl -u umbrel -f

Those will contain the echo logs from any app lifecycle hooks that run. But one gotcha is that the hook file has to be executable. Right now the one in this repo isn't executable so it won't actually run:

$ ls -l stirling-pdf/hooks/pre-start | awk '{print $1}'
-rw-r--r--@

You can fix with chmod +x stirling-pdf/hooks/pre-start

Which means that your tests are showing that we probably don't even have to run the script haha 🎉

@nmfretz nmfretz closed this Nov 28, 2024
@sharknoon
Copy link
Contributor Author

Yes, I agree that not having the hook at all is the best solution. Thank you for explaining how to stream the logs :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants