| .. | ||
| README.md | ||
| restart.sh | ||
| upgrade.js | ||
Forgejo auto-upgrade script
Automatically download and run the latest Forgejo release.
Setup
-
Install the following programs :
-
In your Forgejo instance directory :
- Create the following files :
- a symbolic link of any name to a Forgejo executable (e.g.
ln -s ./forgejo-x.y.z-linux-arch ./forgejo) - a
restart.shscript (e.g. containingsystemctl/screencommands)
- a symbolic link of any name to a Forgejo executable (e.g.
- Download the
upgrade.jsscript
- Create the following files :
-
Add the script to your crontab (e.g.
0 * * * * bash -c "cd <path> && bun ./upgrade.js"to make it run every hour).
My setup
As I'm managing services with screen, I made a custom restart.sh script that :
- stops the currently running screen session (if any) ;
- waits for the Forgejo port to be closed ;
- starts a new screen session ;
- waits for the Forgejo port to be open.
You may use it by providing the following parameters in a .env file :
SCREEN_NAME: thescreensession nameSYMLINK_NAME: the name of the symbolic link to the Forgejo executablePORT: the Forgejo HTTP server's listening port.