Compare commits

...

No commits in common. "780ee2fd37880b956338419e705ffd33c7d8b7a1" and "24940669f12f573386a9961f74819cadb4090663" have entirely different histories.

4 changed files with 33 additions and 0 deletions

5
Dockerfile Normal file
View File

@ -0,0 +1,5 @@
FROM alpine:3.7
COPY drone-ssh-keys.sh /usr/bin/drone-ssh-keys
RUN apk add --no-cache openssh-client rsync

9
Makefile Normal file
View File

@ -0,0 +1,9 @@
IMAGE_NAME := images.abackstrom.com/rsync-ssh
image:
docker build -t $(IMAGE_NAME) .
push:
docker push $(IMAGE_NAME)
.PHONY: image push

View File

@ -1,2 +1,3 @@
# drone-rsync-test
Thu Jun 7 13:56:57 UTC 2018

18
drone-ssh-keys.sh Executable file
View File

@ -0,0 +1,18 @@
#!/bin/sh
if [ -z "$SSH_PRIVATE_KEY" ] ; then
echo "\$SSH_PRIVATE_KEY is not set!" >/dev/stderr
exit 1
fi
if [ -z "$SSH_HOST_KEY" ] ; then
echo "\$SSH_HOST_KEY is not set!" >/dev/stderr
exit 1
fi
mkdir "${HOME}/.ssh"
echo -n "${SSH_PRIVATE_KEY}" > "${HOME}/.ssh/id_rsa"
chmod 700 "${HOME}/.ssh/id_rsa"
echo "${SSH_HOST_KEY}" >> "${HOME}/.ssh/known_hosts"
echo "Created $HOME/.ssh/id_rsa and $HOME/.ssh/known_hosts"