deploy.sh: check binary existence before copying to remote

This commit is contained in:
c9s 2021-06-08 02:00:10 +08:00
parent d1455f66c7
commit 3cf92e9f0e

View File

@ -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..."
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..."