Skip to content

Apache DataFusion SQL Query Engine

ARROW-5793: [Release] Avoid duplicated known host SSH error in dev/release/03-binary.sh

Sutou Kouhei3563a3459de6
diff --git a/dev/release/03-binary.sh b/dev/release/03-binary.sh
index fa1119a3b9..74602cda74 100755
--- a/dev/release/03-binary.sh
+++ b/dev/release/03-binary.sh
@@ -88,13 +88,22 @@ docker_run() {
docker_gpg_ssh() {
local ssh_port=$1
shift
- ssh \
- -o StrictHostKeyChecking=no \
- -i "${docker_ssh_key}" \
- -p ${ssh_port} \
- -R "/home/arrow/.gnupg/S.gpg-agent:${gpg_agent_extra_socket}" \
- "$@"
+ local known_hosts_file=$(mktemp -t "arrow-binary-gpg-ssh-known-hosts.XXXXX")
+ local exit_code=
+ if ssh \
+ -o StrictHostKeyChecking=no \
+ -o UserKnownHostsFile=${known_hosts_file} \
+ -i "${docker_ssh_key}" \
+ -p ${ssh_port} \
+ -R "/home/arrow/.gnupg/S.gpg-agent:${gpg_agent_extra_socket}" \
+ "$@"; then
+ exit_code=$?;
+ else
+ exit_code=$?;
+ fi
+ rm -f ${known_hosts_file}
+ return ${exit_code}
}
docker_run_gpg_ready() {