April 9, 2018 at 1:22 am #13203
If you’re using my automatic update script, you might find this new version useful. As always, the script is located at https://pastebin.com/j657uv9A
However, please be sure you go over the README at https://pastebin.com/nwcSH0TH
So what’s the new functionality? In short, it should now be completely hands-off provided everything is setup correctly. You shouldn’t have to edit any lines whatsoever, and it should “just work.” And as of Invoice Ninja v4.3.0, it will attempt to delete
/bootstrap/cache/compiled.phpif it exists (I’ll leave this in for users who may not be on the absolute latest releases and want to update later).
While I go over this next part in the README, it’s important that you know what assumptions are being made and what the caveats are.
- You have
locateinstalled. If not, you’ll want to do so.
sudo apt install locate
- You have only ONE copy of the Invoice Ninja directory structure on your system (explained below).
- You have sudo access, either to run the script manually, or to run it as a cron task.
- The partition containing
/usr/local/has enough space to store the downloaded ZIP file, as well as to extract the files prior to having them synced to your install folder.
So what are the caveats?
For starters, the script uses
locateto search for a specific composer.json that resides in the Invoice Ninja root directory. This is how it knows where you have IN installed. If there are other copies installed on the same system (or even just the files extracted somewhere),
locatewill return multiple paths, and cause problems. That’s another reason to be 100% sure you have full read/write access to the /usr/local/ folder, as we want to make sure the script removes the extracted files when it’s done with them. Also, the script will run
locateto make sure the path returned is the most up to date. This could take a few seconds on some systems if it hasn’t been run in a while. If you’re running it as a daily cron task, this shouldn’t be an issue, however.
The script will detect whether or not you’re using
UPDATE_SECRETin your .env file, and pass the proper URL to wget with the string you set. However, in some cases, wget will return a 400 error, and the artisan commands will not run. If this happens, you can simply run
wget --spiderwith your URL and
UPDATE_SECRETstring, or visit that same URL in your browser and it will go through on the second attempt. If you have to do that, I suggest removing
UPDATE_SECRETfrom your .env file for now. This issue happens to me whether I’m attempting to trigger the commands with wget, curl, or any browser. Unfortunately, nobody else has reported the same issue, so I’m at a loss as to what could be going on.
Finally, if you still prefer the old version, 4.6.3 of the script has moved to https://pastebin.com/fittpgBBApril 9, 2018 at 6:36 am #13205
That’s amazing!! Thanks for your continued work on the script!April 9, 2018 at 9:22 pm #13237
Happy to help out!
Hopefully someone else encounters the issues with using
UPDATE_SECRETto help figure out what the heck is going on, heh.April 29, 2018 at 3:33 am #13680
Minor revision. Added a 15 second timeout to the first wget commend, so if invoiceninja.com is down for whatever reason (like it was today, apparently), it’s not stuck in a wait state for the default 900 seconds.May 14, 2018 at 8:50 am #13965
Just used this today to successfully update my installation, very useful. Thanks for your work on the script.June 11, 2018 at 10:36 am #14447
Works well on Invoice Ninja 4.4.4.
Just had to carry out some prerequisites. In summary for others, even though this information is available in other posts on this forum:
1) wget/ftp update script to /usr/local/bin directory
2) change permissions:
sudo chmod 755 yourupdatescriptfile.sh
3) install locate as detailed in Titanfail’s post:
sudo apt install locate
3) install dos2unix to remove possible line returns:
sudo apt install dos2unix
4) remove line returns:
sudo dos2unix yourupdatescriptfile.sh
5) run the script:
Thanks very much for this scipt for this script Titanfail. Be nice if there was a button in Invoice Ninja self hosted to run this script with some GUI feedback, but I guess that would mean having some self-hosted specific code.June 13, 2018 at 12:18 am #14572
“Be nice if there was a button in Invoice Ninja self hosted to run this script with some GUI feedback, but I guess that would mean having some self-hosted specific code.”
It probably could be added, but that’s out of the scope Hillel and the team are focusing on, and I’m not about to put in a pull request because that’s way out of my depth, lol. But between my solution, Docker images, and Ansible, it seems there’s an option to fit everyone. Such is the beauty of open source.
As for getting all the information on how to use the script into an easy-to-use format, I plan on making a short howto video whenever I get some time to do it (plus the VO for it would be a nice portfolio piece for me).August 24, 2018 at 2:36 am #15977
Thanks for Automatic Update Script!May 9, 2019 at 12:01 pm #20675
Thanks again Titanfail – just upgraded to 4.5.12 from 4.4 and all appears to have worked well.
- You have
You must be logged in to reply to this topic.