feat: move ssh setup into own setup_ssh.sh script
This commit is contained in:
parent
e67ce93376
commit
4246e28247
18
.drone.yml
18
.drone.yml
|
@ -19,14 +19,7 @@ steps:
|
|||
from_secret: gitea_ssh_key
|
||||
HOME: /root
|
||||
commands:
|
||||
# This is a hack because nixery containers contain no passwd file, which openssh wants to read
|
||||
- echo "root:x:0:0:System administrator:/root:/run/current-system/sw/bin/bash" >> /etc/passwd
|
||||
- mkdir -p ~/.ssh
|
||||
- echo "$$GITEA_SSH_KEY" > ~/.ssh/id_rsa
|
||||
- echo "[git.b12f.io]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ4uaREL7acSSCNAX+voDYl1Kj7JipP62fR5x1UyGP9u" >> ~/.ssh/known_hosts
|
||||
- echo "Host git.b12f.io" >> ~/.ssh/config
|
||||
- echo " Port 2222" >> ~/.ssh/config
|
||||
- chmod -R 600 ~/.ssh
|
||||
- ./.drone/setup_ssh.sh
|
||||
- git clone -b devos git@git.b12f.io:pub-solar/os .
|
||||
- git remote add devos git@git.b12f.io:pub-solar/devos
|
||||
- git fetch --all
|
||||
|
@ -50,14 +43,7 @@ steps:
|
|||
from_secret: gitea_ssh_key
|
||||
HOME: /root
|
||||
commands:
|
||||
# This is a hack because nixery containers contain no passwd file, which openssh wants to read
|
||||
- echo "root:x:0:0:System administrator:/root:/run/current-system/sw/bin/bash" >> /etc/passwd
|
||||
- mkdir -p ~/.ssh
|
||||
- echo "$$GITEA_SSH_KEY" > ~/.ssh/id_rsa
|
||||
- echo "[git.b12f.io]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ4uaREL7acSSCNAX+voDYl1Kj7JipP62fR5x1UyGP9u" >> ~/.ssh/known_hosts
|
||||
- echo "Host git.b12f.io" >> ~/.ssh/config
|
||||
- echo " Port 2222" >> ~/.ssh/config
|
||||
- chmod -R 600 ~/.ssh
|
||||
- ./.drone/setup_ssh.sh
|
||||
- git fetch --all
|
||||
- git checkout --track origin/core
|
||||
- git merge origin/devos
|
||||
|
|
10
.drone/setup_ssh.sh
Executable file
10
.drone/setup_ssh.sh
Executable file
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
# Setup ssh inside container
|
||||
# This is a hack because nixery containers contain no passwd file, which openssh wants to read
|
||||
echo "root:x:0:0:System administrator:/root:/run/current-system/sw/bin/bash" >> /etc/passwd
|
||||
mkdir -p ~/.ssh
|
||||
echo "$GITEA_SSH_KEY" > ~/.ssh/id_rsa
|
||||
echo "[git.b12f.io]:2222 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIJ4uaREL7acSSCNAX+voDYl1Kj7JipP62fR5x1UyGP9u" >> ~/.ssh/known_hosts
|
||||
echo "Host git.b12f.io" >> ~/.ssh/config
|
||||
echo " Port 2222" >> ~/.ssh/config
|
||||
chmod -R 600 ~/.ssh
|
Loading…
Reference in a new issue