Not much of a script but here it is...
git fetch; git pull; ./nodebb stop; npm i; ./nodebb upgrade; npm i; ./nodebb start; ./nodebb log
And for the 1.7.0 to 1.7.1 release we had to switch to this...
git fetch; git pull; ./nodebb stop; npm i; rm -rf ./node_modules/eslint* ; npm i commander; ./nodebb upgrade; npm i; ./nodebb start; ./nodebb log
Obviously our backups are not in that script, we do that manually (not sure why, actually.) Probably because we backup up to ten minutes ahead of doing the actual update as we can do that without impact and ensure we are at a lull before going down for a few seconds. So we keep it manual. We don't have a copy of the main database that we use for testing, but we have a series of separate sites that run the same code that range from pure test (their own data, but no live users) to insanely low use (users less than once a week) to moderate use but non-business before getting to the big main site. So we use that as our testing profile.