Deploy helper to run SSH commands in secure manner.
10K+
Deploy helper to run SSH commands in secure manner.
Private SSH key need to be specified in SSH_KEY_DEPLOYER secret variables.
Here is an example of .gitlab-ci.yml to show how to use this image with Gitlab-CI
stages:
- deploy # define deploy stage
deploy-dev:
type: deploy
image: eagafonov/ci-ssh-deployer # us this image as base
variables:
SSH_STRICT_HOST_KEY_CHECKING: no
script:
- test -n "$SSH_KEY_DEPLOYER" # Just to make sure the SSH Key is defided in CI Settings
# Run 'make deploy' on target host
- ssh [email protected] make deploy
only:
- /^ci-dev-.*$/
Value for StrictHostKeyChecking SSH option. Set to no to disable host key checking.
Security notice Its totally unsafe to disable host key checking but suitable in some cases. For example it's fine to disable it if SSH access is performed within secured private network so MITM is not possible.
Its much better to provide valid known_hosts files as /home/safeuser/.ssh/known_hosts.
The content of private ssh to be added into ssh agent.
Content type
Image
Digest
Size
12.1 MB
Last updated
over 8 years ago
docker pull eagafonov/ci-ssh-deployer