This script send you a notification when a new version of gitea is available. It can update gitea with only one command.
- Gitea
- Bash
- mailx
This script will be launched manually or through a cron :
- check last version of gitea on github
- check if version is different than current version
- send you a notification if new version available and option -n (or -c for dry-run)
- run update if new version available and option -u
-
Install this script where you want (i.e. : /usr/local/bin/gitea-update.sh )
cp gitea-update.sh /usr/local/bin/
-
Edit it with the good values in the part VARIABLES (see Configure variables)
-
Change rights
chmod 700 /usr/local/bin/gitea-update.sh
-
Add cron for periodic check (i.e. every day at 5am)
echo "0 5 * * * root /usr/local/bin/gitea-update.sh -n >/dev/null" > /etc/cron.d/gitea
-
Check if it works : /usr/local/bin/gitea-update.sh -c
-
No restart needed.
-
When new version available, use the option -u as like as the noficitaion suggest
go to the 'VARIABLES' part in the script
key | value | example |
---|---|---|
MAIL_FROM | sender | 'Your Mail<[email protected]>' |
MAIL_TO | destination | '<[email protected]>' |
GITEA_PATH | path where gitea is installed | "/usr/local/bin/" |
GITEA_USER | dedicated user for gitea | "gitea" |
CHANGE_LOG_MAX_LINES | max lines of changlog returned in notification | 100 |
-
remove this script (i.e. if installed in suggested path)
rm /usr/local/bin/gitea-update.sh
-
remove cron file
rm /etc/cron.d/gitea
Usage : ${0##*/} <Option>
Option :
-c : Check (Dry-Run notification)
-n : Notify when update are available
-u : do the update
PiDroid-B, 2019
Use it at your own risk. The author assumes no responsibility for all usage or error that result from this script.
This project is licensed under the GPL v3 License. See the LICENSE file for the full license text.
version | release | date | description |
---|---|---|---|
1.0.0 | 2019-08-24 | Init |