Send an email in case of error
[stakingWatchdog.git] / deploy.nu
index a7305c9..6945067 100644 (file)
--- a/deploy.nu
+++ b/deploy.nu
@@ -1,7 +1,10 @@
+# 'zigbuild' is needed to build for target 'x86_64-unknown-linux-gnu' on linux:
+# https://github.com/rust-cross/cargo-zigbuild
+
 def main [host: string, destination: string, ssh_key: path] {
     let ssh_args = [-i $ssh_key $host]
     let scp_args = [-r -i $ssh_key]
-    let target = "x86_64-unknown-linux-musl"
+    let target = "x86_64-unknown-linux-gnu"
     let app_name = "staking_watchdog"
     let build = "debug" # "debug" or "release".
 
@@ -19,9 +22,9 @@ def main [host: string, destination: string, ssh_key: path] {
 
     # Don't know how to dynamically pass variable arguments.
     if $build == "release" {
-        cargo build --target $target --release
+        cargo zigbuild --target $target --release
     } else {
-        cargo build --target $target
+        cargo zigbuild --target $target
     }
 
     # invoke_ssh [sudo systemctl stop $app_name]