You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by ko...@apache.org on 2019/06/30 05:40:51 UTC

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

This is an automated email from the ASF dual-hosted git repository.

kou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new dff73a4  ARROW-5793: [Release] Avoid duplicated known host SSH error in dev/release/03-binary.sh
dff73a4 is described below

commit dff73a4a8d2ec6ab4601e274226f328008693631
Author: Sutou Kouhei <ko...@clear-code.com>
AuthorDate: Sun Jun 30 14:40:38 2019 +0900

    ARROW-5793: [Release] Avoid duplicated known host SSH error in dev/release/03-binary.sh
    
    Author: Sutou Kouhei <ko...@clear-code.com>
    
    Closes #4753 from kou/release-upload-binary-avoid-known-host-duplication and squashes the following commits:
    
    7fc0018bc <Sutou Kouhei>  Avoid duplicated known host SSH error in dev/release/03-binary.sh
---
 dev/release/03-binary.sh | 23 ++++++++++++++++-------
 1 file changed, 16 insertions(+), 7 deletions(-)

diff --git a/dev/release/03-binary.sh b/dev/release/03-binary.sh
index fa1119a..74602cd 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}" \
-    arrow@127.0.0.1 \
-    "$@"
+  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}" \
+      arrow@127.0.0.1 \
+      "$@"; then
+    exit_code=$?;
+  else
+    exit_code=$?;
+  fi
+  rm -f ${known_hosts_file}
+  return ${exit_code}
 }
 
 docker_run_gpg_ready() {