Unverified Commit 592eb15c authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

add update.sh example script

parent 2f01ea6f
Loading
Loading
Loading
Loading

update.sh

0 → 100755
+25 −0
Original line number Diff line number Diff line
#!/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