diff options
author | Daniel Friesel <derf@finalrewind.org> | 2021-09-12 11:29:39 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2021-09-12 11:35:17 +0200 |
commit | 592eb15cababc99c15426f78b8e9540303d770ad (patch) | |
tree | 9bdb08ea036426e0ade74343705bd6e004f1b067 | |
parent | 2f01ea6f0daa5cb7d2213d2effee46f9399293ad (diff) |
add update.sh example script
-rwxr-xr-x | update.sh | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/update.sh b/update.sh new file mode 100755 index 0000000..d78f8a5 --- /dev/null +++ b/update.sh @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Updates a travelynx instance deployed via git. Performs database migrations +# as necessary. + +git pull + +if [ "$1" = "with-deps" ]; then + mkdir local.new + cd local.new + cp ../cpanfile* . + carton install + cd .. + sudo systemctl stop travelynx + mv local local.old + mv local.new/local . + perl index.pl database migrate + sudo systemctl start travelynx +elif perl index.pl database has-current-schema; then + sudo systemctl reload travelynx +else + sudo systemctl stop travelynx + perl index.pl database migrate + sudo systemctl start travelynx +fi |