installer key

This commit is contained in:
2024-08-25 09:14:37 +02:00
parent 2157d8c405
commit 66fe634955
2 changed files with 20 additions and 1 deletions

View File

@@ -35,6 +35,22 @@ CURL_RETRIES=${CURL_RETRIES:-360}
SCHEDULER_SERVICEFILE_GENERATE_TEST=${SCHEDULER_SERVICEFILE_GENERATE_TEST:-false}
check_installer_key() {
mkdir -p /root/.ssh
if [ -f /etc/user/data/installer ]; then
ln -s /etc/user/data/installer /root/.ssh/id_rsa
echo '
Host git.format.hu
User git
Port 20202
HostName git.format.hu
PreferredAuthentications publickey
IdentityFile /root/.ssh/id_rsa
IdentitiesOnly yes
StrictHostKeyChecking no
' > /root/.ssh/config
fi
}
if [[ -n "$DOCKER_REGISTRY_URL" && "$DOCKER_REGISTRY_URL" != "null" ]]; then
SETUP="/setup"
@@ -144,6 +160,9 @@ get_repositories(){
REPOS=$(jq -r .repositories[] /etc/user/config/repositories.json); # list of repos, delimiter by space
for REPO in $REPOS; do
check_installer_key
BASE=$(basename $REPO | cut -d '.' -f1)
if [ ! -f "/tmp/$BASE" ]; then
git clone $REPO /tmp/$BASE;