added ssh
This commit is contained in:
parent
7ab29ce157
commit
a55ea6c372
@ -16,3 +16,5 @@ scripts:
|
|||||||
type: shell
|
type: shell
|
||||||
deploy_release:
|
deploy_release:
|
||||||
type: shell
|
type: shell
|
||||||
|
setup_ssh:
|
||||||
|
type: shell
|
||||||
|
25
scripts/setup_ssh.sh
Executable file
25
scripts/setup_ssh.sh
Executable file
@ -0,0 +1,25 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
if [ ! -d ~/.ssh ]; then
|
||||||
|
mkdir -p ~/.ssh
|
||||||
|
chmod 700 ~/.ssh
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$SSH_KEY" ]; then
|
||||||
|
SSH_KEY_ID="$HOME/.ssh/id_ed25519"
|
||||||
|
echo $SSH_KEY > $SSH_KEY_ID
|
||||||
|
|
||||||
|
chmod 600 $SSH_KEY_ID
|
||||||
|
|
||||||
|
# Append the required to the ssh config file.
|
||||||
|
# Switch out the hostname for different hosts.
|
||||||
|
# The line count is 5
|
||||||
|
echo "\nHost ci.i.kjuulh.io\n"\
|
||||||
|
" IdentityFile ${SSH_KEY_ID}\n"\
|
||||||
|
" IdentitiesOnly yes\n"\
|
||||||
|
" UserKnownHostsFile=/dev/null\n"\
|
||||||
|
" StrictHostKeyChecking no"\
|
||||||
|
>> $HOME/.ssh/config
|
||||||
|
fi
|
Loading…
Reference in New Issue
Block a user