From 3cf92e9f0e9d98055e9cf8ff4ffa46345d465ab0 Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 8 Jun 2021 02:00:10 +0800 Subject: [PATCH] deploy.sh: check binary existence before copying to remote --- deploy.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/deploy.sh b/deploy.sh index 8a314bbd3..9361423f9 100644 --- a/deploy.sh +++ b/deploy.sh @@ -118,7 +118,12 @@ make $bin_type-$host_os-$host_arch # copy the binary to the server info "deploying..." info "copying binary to host $host..." -scp build/bbgo/$bin_type-$host_os-$host_arch $host:$host_bin_dir/bbgo-$tag + +if [[ $(remote_test "-e $host_bin_dir/bbgo-$tag") != "yes" ]] ; then + scp build/bbgo/$bin_type-$host_os-$host_arch $host:$host_bin_dir/bbgo-$tag +else + info "binary $host_bin_dir/bbgo-$tag already exists, we will use the existing one" +fi # link binary and restart the systemd service info "linking binary and restarting..."