summaryrefslogtreecommitdiffstats
path: root/scripts/sh/_templates/goapps/update_app.sh
diff options
context:
space:
mode:
authorGeorg2022-01-02 06:36:45 +0100
committerGeorg2022-01-02 06:36:45 +0100
commit935b8c642f8aaed31bca17faccaedf0e57ba9efd (patch)
treedeb1d2bdd53aef299f59fb1aebc459884fc264f3 /scripts/sh/_templates/goapps/update_app.sh
parent134560a32d52329a59906de5392e69df9608368c (diff)
parentdc8f806686172d490ae50ac0f9f5d2cdc887d61b (diff)
downloadsystem-935b8c642f8aaed31bca17faccaedf0e57ba9efd.tar.gz
system-935b8c642f8aaed31bca17faccaedf0e57ba9efd.tar.bz2
system-935b8c642f8aaed31bca17faccaedf0e57ba9efd.zip
Merge branch 'master' of ssh://git.com.de:28/LibertaCasa/system
Diffstat (limited to 'scripts/sh/_templates/goapps/update_app.sh')
-rw-r--r--scripts/sh/_templates/goapps/update_app.sh26
1 files changed, 26 insertions, 0 deletions
diff --git a/scripts/sh/_templates/goapps/update_app.sh b/scripts/sh/_templates/goapps/update_app.sh
new file mode 100644
index 0000000..bbc0b1e
--- /dev/null
+++ b/scripts/sh/_templates/goapps/update_app.sh
@@ -0,0 +1,26 @@
+#!/bin/sh
+
+# Only supports git source builds currently.
+
+if [ -f /opt/app/app-git/app ]
+then
+echo "This will immediately stop app if it is running. Update app on this system? "
+read text -r
+expr "$text" : "^[Yy]$" > /dev/null
+if [ "$text" ]
+then
+# Inconsistent `sudo` use?
+systemctl stop app.service
+
+# Update golang using `deploy_go`
+
+cd /opt/app/app-git || exit
+rm -f app
+git pull
+sudo -u app make build
+# insert misc commands as needed.
+systemctl start app.service
+fi
+else
+echo "app does not seem to be installed. Consider deploy_app.sh."
+fi \ No newline at end of file