deploy.sh: add UPLOAD_ONLY option

This commit is contained in:
c9s 2022-08-07 11:27:27 +08:00
parent 75e671a96f
commit 1671e494d3
No known key found for this signature in database
GPG Key ID: 7385E7E464CB0A54

View File

@ -168,8 +168,13 @@ 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..."
ssh $host "(cd $target && ln -sf \$HOME/$host_bin_dir/bbgo-$tag bbgo && sudo systemctl restart $target.service)"
if [[ -n "$UPLOAD_ONLY" ]] ; then
# link binary and restart the systemd service
info "linking binary"
ssh $host "(cd $target && ln -sf \$HOME/$host_bin_dir/bbgo-$tag bbgo)"
else
info "linking binary and restarting..."
ssh $host "(cd $target && ln -sf \$HOME/$host_bin_dir/bbgo-$tag bbgo && sudo systemctl restart $target.service)"
fi
info "deployed successfully!"