From dbe2c3b63d69421e91349b9b3067c7efc3ea80bc Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Wed, 13 Nov 2019 18:48:29 +0100 Subject: [PATCH] chg: pkg: externalized ``git.0k.io`` access patching code from freezer code. --- .../ensure-git-0k-access.sh | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .drone.d/update-pre-build.d/ensure-git-0k-access.sh diff --git a/.drone.d/update-pre-build.d/ensure-git-0k-access.sh b/.drone.d/update-pre-build.d/ensure-git-0k-access.sh new file mode 100644 index 0000000..b7b7dc3 --- /dev/null +++ b/.drone.d/update-pre-build.d/ensure-git-0k-access.sh @@ -0,0 +1,23 @@ +## These instruction are sent to ``dupd`` on target image (doodba) + +set -ex + +mkdir -p /root/.ssh + +curl https://docker.0k.io/get/vm_git_access_id_rsa > /root/.ssh/id_rsa || { + echo "Fatal: Could not retrieve http://docker.0k.io/get/vm_git_access_id_rsa ..." >&2 + exit 1 +} +## Not so usefull as it is public ! +chmod 0600 /root/.ssh/id_rsa + +ssh-keyscan -H -p 10022 git.0k.io > /root/.ssh/known_hosts +chmod 600 /root/.ssh/known_hosts + +cat < /root/.ssh/config + +Host git.0k.io + User vm-user + Port 10022 + +EOF