This commit is contained in:
parent
1ab79d9a1a
commit
8d9babd744
@ -8,11 +8,11 @@ steps:
|
|||||||
image: alpine
|
image: alpine
|
||||||
commands:
|
commands:
|
||||||
- sh compile.sh
|
- sh compile.sh
|
||||||
- apk add openssh
|
- apk add rsync openssh
|
||||||
- sh deploy.sh
|
- sh deploy.sh
|
||||||
environment:
|
environment:
|
||||||
SSH_CONNECTION_STRING:
|
RSYNC_DESTINATION:
|
||||||
from_secret: SSH_CONNECTION_STRING
|
from_secret: RSYNC_DESTINATION
|
||||||
SSH_KEY:
|
SSH_KEY:
|
||||||
from_secret: SSH_KEY
|
from_secret: SSH_KEY
|
||||||
|
|
||||||
|
@ -4,6 +4,6 @@ instructions:
|
|||||||
|
|
||||||
1. generate a new ssh key with no password (i.e. @ /tmp/id_ed25519)
|
1. generate a new ssh key with no password (i.e. @ /tmp/id_ed25519)
|
||||||
2. add the key to .ssh/authorized_keys @ tilde.club
|
2. add the key to .ssh/authorized_keys @ tilde.club
|
||||||
3. set SSH_CONNECTION_STRING in drone.io worker secrets to "<username>@tilde.club"
|
3. set RSYNC_DESTINATION in drone.io worker secrets to "<username>@tilde.club:/home/<username>"
|
||||||
4. set SSH_KEY to (echo /tmp/id_ed25519 | base64 -e --wrap=0)
|
4. set SSH_KEY to (echo /tmp/id_ed25519 | base64 -e --wrap=0)
|
||||||
5. profit (keep it simple! don't want env vars leaking for obvious reasons...)
|
5. profit (keep it simple! don't want env vars leaking for obvious reasons...)
|
||||||
|
@ -4,6 +4,13 @@ set -e
|
|||||||
|
|
||||||
echo $SSH_KEY | base64 -d >> /tmp/key
|
echo $SSH_KEY | base64 -d >> /tmp/key
|
||||||
chmod -R 0600 /tmp/key
|
chmod -R 0600 /tmp/key
|
||||||
scp -o StrictHostKeyChecking=no -i /tmp/key -r dist/* $SSH_CONNECTION_STRING:~
|
|
||||||
|
cd dist
|
||||||
|
for i in .; do
|
||||||
|
echo "copying $i"
|
||||||
|
rsync -e "ssh -i /tmp/key -o StrictHostKeyChecking=no" -avz --delete $i $RSYNC_DESTINATION/$i
|
||||||
|
done
|
||||||
|
echo "finished copying to remote host..."
|
||||||
|
cd ..
|
||||||
|
|
||||||
rm /tmp/key
|
rm /tmp/key
|
||||||
|
Loading…
Reference in New Issue
Block a user