From 25d2611b060f7a53f19d4e5bad42a2fb2c4a7a80 Mon Sep 17 00:00:00 2001 From: TapTap21 Date: Mon, 2 Nov 2020 16:18:27 +0200 Subject: [PATCH] FIX add ports to ssh-keyscan --- action.yml | 2 +- docker-entrypoint.sh | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/action.yml b/action.yml index 93fe49b..fe94b07 100644 --- a/action.yml +++ b/action.yml @@ -32,7 +32,7 @@ inputs: runs: using: docker - image: docker://taptap21/docker-remote-deployment-action:v1.0 + image: docker://taptap21/docker-remote-deployment-action:v1.1 branding: icon: send diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 8119d7a..a51573c 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -59,16 +59,14 @@ ssh-add ~/.ssh/id_rsa echo "Add known hosts" -#printf '%s %s\n' "$SSH_HOST" "$INPUT_SSH_PUBLIC_KEY" >> /etc/ssh/ssh_known_hosts -ssh-keyscan "$SSH_HOST" >> ~/.ssh/known_hosts -ssh-keyscan "$SSH_HOST" >> /etc/ssh/ssh_known_hosts +ssh-keyscan -p $INPUT_SSH_PORT "$SSH_HOST" >> ~/.ssh/known_hosts +ssh-keyscan -p $INPUT_SSH_PORT "$SSH_HOST" >> /etc/ssh/ssh_known_hosts # set context echo "Create docker context" docker context create staging --docker "host=ssh://$INPUT_REMOTE_DOCKER_HOST:$INPUT_SSH_PORT" docker context use staging -docker ps if [ -n "$INPUT_DOCKER_LOGIN_PASSWORD" ] || [ -n "$INPUT_DOCKER_LOGIN_USER" ] || [ -n "$INPUT_DOCKER_LOGIN_REGISTRY" ]; then echo "Connecting to $INPUT_REMOTE_DOCKER_HOST... Command: docker login" docker login -u "$INPUT_DOCKER_LOGIN_USER" -p "$INPUT_DOCKER_LOGIN_PASSWORD" "$INPUT_DOCKER_LOGIN_REGISTRY"