Last active
May 15, 2024 14:26
-
-
Save pedrom34/d1b8ab84e1e9ec7e8c6cbcc3cc51d663 to your computer and use it in GitHub Desktop.
Script to update firefly-iii
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 | |
#Modify next line to where your firefly-iii instance is installed to. | |
cd /var/www | |
#Remove old backup of firefly-iii | |
rm -r firefly-iii-old | |
#Backup current version of firefly-iii | |
cp -r firefly-iii firefly-iii-old | |
#Get latest version of firefly | |
latestversion=$(curl -s https://api.github.com/repos/firefly-iii/firefly-iii/releases/latest \ | |
| grep "tag_name" \ | |
| awk '{print "https://github.com/firefly-iii/firefly-iii/releases/download/" substr($2, 2, length($2)-3) "/FireflyIII-" substr($2, 2, length($2)-3) ".zip"}') \ | |
; curl -L -o firefly-iii.zip $latestversion | |
#Install latest version | |
unzip firefly-iii.zip -x "storage/*" -d /var/www/firefly-iii | |
cd firefly-iii | |
yes | composer install --no-scripts --no-dev | |
yes | composer install --no-dev | |
php artisan migrate --seed | |
php artisan firefly-iii:decrypt-all | |
php artisan cache:clear | |
php artisan firefly-iii:upgrade-database | |
php artisan passport:keys | |
php artisan cache:clear | |
#Serve next version, make sure rights are ok, restart apache2 | |
cd .. | |
chown -R www-data:www-data firefly-iii | |
chmod -R 775 firefly-iii/storage | |
sleep 5 | |
service apache2 restart | |
rm firefly-iii.zip |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment