mirror of
https://github.com/KevinMidboe/nginx.git
synced 2025-10-29 17:50:26 +00:00
ssh-add deploy key & keyscan to populate known_hosts
This commit is contained in:
16
.drone.yml
16
.drone.yml
@@ -65,16 +65,20 @@ steps:
|
|||||||
- name: Setup credentials
|
- name: Setup credentials
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
commands:
|
commands:
|
||||||
- mkdir .ssh
|
- mkdir -p .ssh
|
||||||
- echo $NGINX_FINGERPRINT | base64 -di > .ssh/known_hosts
|
- apk update
|
||||||
- echo $NGINX_DEPLOY_KEY | base64 -di > .ssh/id_ed25519
|
- apk add openssh-client
|
||||||
|
- eval $(ssh-agent -s)
|
||||||
|
- echo "$NGINX_DEPLOY_KEY" | base64 -di > .ssh/id_ed25519
|
||||||
- echo "" >> .ssh/id_ed25519
|
- echo "" >> .ssh/id_ed25519
|
||||||
- chmod 600 .ssh/id_ed25519
|
- cat .ssh/id_ed25519 | tr -d '\r' | ssh-add - > /dev/null
|
||||||
|
- touch .ssh/known_hosts
|
||||||
|
- ssh-keyscan $NGINX_HOST >> .ssh/known_hosts
|
||||||
environment:
|
environment:
|
||||||
NGINX_FINGERPRINT:
|
|
||||||
from_secret: NGINX_FINGERPRINT
|
|
||||||
NGINX_DEPLOY_KEY:
|
NGINX_DEPLOY_KEY:
|
||||||
from_secret: NGINX_DEPLOY_KEY
|
from_secret: NGINX_DEPLOY_KEY
|
||||||
|
NGINX_HOST:
|
||||||
|
from_secret: NGINX_HOST
|
||||||
|
|
||||||
- name: Deploy
|
- name: Deploy
|
||||||
image: alpine/git
|
image: alpine/git
|
||||||
|
|||||||
Reference in New Issue
Block a user