Avoid systemd in user mode master
authorGreg Burri <greg.burri@gmail.com>
Sun, 23 Jun 2024 21:58:17 +0000 (23:58 +0200)
committerGreg Burri <greg.burri@gmail.com>
Sun, 23 Jun 2024 21:58:17 +0000 (23:58 +0200)
deploy.nu

index 7589874..ae8f52f 100644 (file)
--- a/deploy.nu
+++ b/deploy.nu
@@ -18,12 +18,13 @@ def main [host: string, destination: string, ssh_key: path] {
     copy_ssh "ice/" $destination
 
     cargo build --target $target --release
     copy_ssh "ice/" $destination
 
     cargo build --target $target --release
-    invoke_ssh [systemctl --user stop mumble_web]
+    invoke_ssh [sudo systemctl stop mumble_web]
     copy_ssh ./target/($target)/release/mumble_web $destination
     invoke_ssh [rm -rf $"($destination)/static"]
     copy_ssh ./static/ $destination
     copy_ssh ./target/($target)/release/mumble_web $destination
     invoke_ssh [rm -rf $"($destination)/static"]
     copy_ssh ./static/ $destination
-    invoke_ssh [chmod u+x $"($destination)/mumble_web"]
-    invoke_ssh [systemctl --user start mumble_web]
+    invoke_ssh [chmod gu+x $"($destination)/mumble_web"]
+    invoke_ssh [chgrp -R www-data $"($destination)/mumble_web"]
+    invoke_ssh [sudo systemctl start mumble_web]
     print "Deployment finished"
 }
 
     print "Deployment finished"
 }