-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Update check without shutdown #177
Update check without shutdown #177
Conversation
We just had an update so there's likely a decent amount of time before another one hits. One thing I've been pondering would be the use of adding a if odin update --check; then
# Time to update
pidof valheim_server.x86_64
SERVER_RUNNING=$?
if [[ -n $SERVER_RUNNING ]]; then
odin stop
fi
odin backup blah blah blah
odin update
if [[ -n $SERVER_RUNNING ]]; then
odin start
fi
fi to simply odin update --backup blah blah blah I think this would be nice since it drastically reduces the complexity from how we will likely do backups (can still do checking for if they want to backup on update, but it should still be much much simpler. |
I would like to keep the backup command separate for a separation of concern, I do want to add a restore command which would unzip the contents for the user. Thoughts? |
That sounds good on the And I do agree that the odin backup [create | restore] FILEPATH would work out really well. Doing a nested subcommand helps group the functionality better, and since odin knows about backups are being created from / restored to we should only need the filepath to the backup itself. I also think it would be a good idea to have the |
I think most of the logic should be good now. I've tested
And I still need to add in the new documentation that shouldn't take very long |
…e-check-without-shutdown
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need to address pending actions from other comments with testing and updating documentation too
…e-check-without-shutdown
…anHorror/valheim-docker into update-check-without-shutdown
Alright all manual testing done, and I'm pretty happy with the final state of things, so it's finally time to graduate this to a normal PR 🎉 OverviewRestructuring
Update FunctionalityExternally you can manage different update functionality with Within
DocumentationThe description under Note: I was going to update the TestingI manually tested this a decent bit, but having more people test things out is never a bad thing :D Additionally I added in unit tests that should cover all the update checking functionality! |
The dry run and detection seem to work well. But I did not manage to simulate an update by changing the value of the buildid in steamapps/appmanifest_896660.acf. Odin did detect that a new version existed when I modified it, but steamcmd seems to check somewhere else because that only change was not enough for it to accept to update.
As you can see it only restarts my server without trying to download a new version because steamcmd says it's "already up to date". So it's probably just my test method which wasn't great. Otherwise, dry run, auto-detection with a change to the buildid and force option worked alright! So, as far as I was able to test it, this PR seems great to me, thank you! :) |
Glad that you were willing to try it out! I've got an outdated server instance I'm keeping around and it does perform an update on it when I run |
@mbround18 do you think the PR can be merged? I see that 1 change is marked as requested and blocking the merge, but I can not see any unresolved conversation, that's strange (but I'm more familiar with Gitlab reviewing process, so maybe I'm missing something). |
He's looking over it tonight! |
I am going to be running this on multiple systems after work today to validate it. I have done a precursory set of tests to check and the code looks good but I want to push it up to some live environments to test. |
@dkurzaj and all, Image up for testing: Use it for a preview, this is going up on several servers right now. As a heads up, I am going to let it bake over night to validate the auto update cron and a few things. |
Closes: #129
Description
Contributions
This is obviously still missing some bits that I'm planning on finishing up tomorrow, but I've got some other stuff to get done now so I'm just submitting my current progress.
Accomplishes
odin update
subcommand including respecting--dry-run
,--check
, and--force
flagsTODO
Add in env var flag to check for updates on shutdown (or maybe startup, or both?)update
subcommandChecklist