Created
March 26, 2020 14:37
-
-
Save mriedmann/d0cc8041d1374a38ae734ca2139498ef to your computer and use it in GitHub Desktop.
humhub-docker update script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
CUR_VERSION=$(grep 'ARG HUMHUB_VERSION=' Dockerfile | tr "=" "\n" | tail -n 1) | |
NEW_VERSION=${NEW_VERSION:-$(curl -s https://api.github.com/repos/humhub/humhub/releases | jq -r '.[0] | .name')} | |
if [ "$CUR_VERSION" == "$NEW_VERSION" ]; then | |
echo "no update needed" | |
exit 0 | |
else | |
echo "updating from $CUR_VERSION to $NEW_VERSION" | |
fi | |
GIT_BRANCH="update-$NEW_VERSION" | |
git branch $GIT_BRANCH || true | |
git checkout $GIT_BRANCH | |
sed -i -e "s/ARG HUMHUB_VERSION=[0-9\.]*/ARG HUMHUB_VERSION=$NEW_VERSION/" Dockerfile | |
for LINE in 'humhub:$V' '\`$V\`' | |
do | |
S="s/" | |
for V in $CUR_VERSION $NEW_VERSION; do | |
S+="$(eval echo $LINE)/" | |
done | |
S+="g" | |
echo $S | |
sed -i -e "$S" README.md | |
done | |
git add Dockerfile | |
git add README.md |
Hi! No, this script is used to automate updates of the image itself if the humhub-team releases a new version. This has nothing to do with application (humhub) updates.
For updating humhub it should be sufficient to pull the new version and start it, targeting the same data folders and database. It should then apply the needed database updates automatically (always do backups!).
Yeah. I am working on a traditional approach. Will share if after I'm done.
Thanks for the inspiration with the GitHub api endpoint.
Cheers!
On Wed, 27 May 2020 at 09:47, Michael Riedmann ***@***.***> wrote:
***@***.**** commented on this gist.
------------------------------
Hi! No, thos script is used to automate updates of the image itself if the
humhub-team releases a new version. This has nothing to do with application
(humhub) updates.
For updating humhub it should be sufficient to pull the new version and
start it, targeting the same data folders and database. It should then
apply the needed database updates automatically (always do backups!).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://gist.github.com/d0cc8041d1374a38ae734ca2139498ef#gistcomment-3319472>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANH7T6EARXPS6SMMRIDNLTRTSZPLANCNFSM4NLOACXQ>
.
--
Alex Szilagyi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@mriedmann: Does this script handles step by step update? I'm running an old version does it loops through the versions and applies to each version the changes needed?