X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=deploy.nu;h=b8fb962b4cb865276fe5b922c4ef49bb512bda76;hb=507c694cf6672969f9003324a4783c91bf31f764;hp=a7305c9e1c48348d2a9b7dd57efc124fdc2250bf;hpb=bd25470e4d4c104ab661fe6212f56179d9a32b32;p=stakingWatchdog.git diff --git a/deploy.nu b/deploy.nu index a7305c9..b8fb962 100644 --- a/deploy.nu +++ b/deploy.nu @@ -1,9 +1,12 @@ +# '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". + let build = "release" # "debug" or "release". def invoke_ssh [command: string] { let args = $ssh_args ++ $command @@ -19,14 +22,14 @@ 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] + # invoke_ssh $"sudo systemctl stop ($app_name)" copy_ssh ./target/($target)/($build)/($app_name) $destination invoke_ssh $"chmod u+x ($destination)/($app_name)" - # invoke_ssh [sudo systemctl start $app_name] + # invoke_ssh $"sudo systemctl start ($app_name)" print "Deployment finished" } \ No newline at end of file