Skip to content

Commit

Permalink
FIX add ports to ssh-keyscan
Browse files Browse the repository at this point in the history
  • Loading branch information
TapTap21 committed Nov 2, 2020
1 parent d54b992 commit 25d2611
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 2 additions & 4 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 25d2611

Please sign in to comment.