Docker image to run remote commands via SSH.
To add your host to the known hosts of the SSH agent, simply add the content to the environment variable $SSH_KNOWN_HOSTS
.
To get the the public key for your host, you can use ssh-keyscan
$ ssh-keyscan -p <port> <ip-or-hostname>
Put the output of the command into the $SSH_KNOWN_HOSTS
environment variable.
To add your SSH private key, add the content of your private key to the environment variable $SSH_PRIVATE_KEY
.
To use this image via GitLab CI add the following to the .gitlab-ci.yml
:
deploy:
stage: deploy
image: sourceboat/deploy:latest
script:
- ssh $HOST <your command>
Make sure, the environment variable $SSH_KNOWN_HOSTS
and/or $SSH_PRIVATE_KEY
are set in your project settings.
Check releases for all notable changes.
The MIT License (MIT). Please see License File for more information.