summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsupahgreg <supahgreg@users.noreply.github.com>2025-10-08 16:34:35 +0000
committersupahgreg <supahgreg@users.noreply.github.com>2025-10-08 16:34:35 +0000
commitb709a73e34dcf0ee280fa32092e9b3715e757645 (patch)
tree7db73c706939a629759d25bd43b74cf110b07dab
parentbb1fd07149bd72afc953528a5b7d996678c06361 (diff)
Also migrate 'official' plugins that are from the old site but are using 'main'.
These would be plugins cloned from 'git.tt-rss.org' after the Cloudflare redirect to their corresponding GitHub repos was implemented. Their remote should be updated to just use the GitHub URLs directly.
-rw-r--r--.docker/app/startup.sh30
1 files changed, 20 insertions, 10 deletions
diff --git a/.docker/app/startup.sh b/.docker/app/startup.sh
index df730c336..64111dd19 100644
--- a/.docker/app/startup.sh
+++ b/.docker/app/startup.sh
@@ -102,16 +102,26 @@ if [ -z "$TTRSS_NO_STARTUP_PLUGIN_UPDATES" ]; then
esac
if [ -n "$NEW_ORIGIN_URL" ]; then
- if [ $(sudo -u app git branch --show-current) = "master" ]; then
- echo "Migrating origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL}"
- sudo -u app git remote set-url origin "$NEW_ORIGIN_URL"
- sudo -u app git branch -m master main
- sudo -u app git fetch origin
- sudo -u app git branch --set-upstream-to origin/main main
- sudo -u app git remote set-head origin --auto
- else
- echo "Skipping migration of origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL} (local branch is not 'master')"
- fi
+ case $(sudo -u app git branch --show-current) in
+ master)
+ echo "Migrating origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL} (and switching the branch from 'master' to 'main')"
+ sudo -u app git remote set-url origin "$NEW_ORIGIN_URL"
+ sudo -u app git branch -m master main
+ sudo -u app git fetch origin
+ sudo -u app git branch --set-upstream-to origin/main main
+ sudo -u app git remote set-head origin --auto
+ ;;
+ main)
+ echo "Migrating origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL}"
+ sudo -u app git remote set-url origin "$NEW_ORIGIN_URL"
+ sudo -u app git fetch origin
+ sudo -u app git branch --set-upstream-to origin/main main
+ sudo -u app git remote set-head origin --auto
+ ;;
+ *)
+ echo "Skipping migration of origin remote from ${ORIGIN_URL} to ${NEW_ORIGIN_URL} (local branch is not 'master' or 'main')"
+ ;;
+ esac
fi
fi