From a8585ea76d1a1f0afdd7c4eb048bbf10698d3a8d Mon Sep 17 00:00:00 2001 From: adam Date: Mon, 24 Mar 2025 23:02:23 -0400 Subject: [PATCH] keyscan earlier - scp was giving me host key verification failed --- scripts/1clickservice.groovy | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/1clickservice.groovy b/scripts/1clickservice.groovy index 74deb60..b32e97b 100644 --- a/scripts/1clickservice.groovy +++ b/scripts/1clickservice.groovy @@ -228,13 +228,15 @@ pipeline { script { withCredentials([sshUserPrivateKey(credentialsId: env.SUDOERSSHID, keyFileVariable: 'PK')]) { + sh """#!/bin/bash + ssh-keyscan -t ed25519 ${targetHost} >> ~/.ssh/known_hosts + """ + sh """#!/bin/bash scp -i \"${PK}\" ${servicename}-ssh.pub ${SUDOER_USR}@${targetHost}:~/ssh.pub """ - sh """#!/bin/bash - ssh-keyscan -t ed25519 ${targetHost} >> ~/.ssh/known_hosts - + sh """#!/bin/bash curl -u '${env.GITEA_USR}:${env.GITEATOKEN}' https://gitea.arg.rip/greyn/deployment/raw/branch/main/scripts/serviceaccount.sh --output serviceaccount.sh sed -i 's/USERNAMETOADD=/USERNAMETOADD="${servicename}"/' serviceaccount.sh sed -i 's/PASSWORDTOADD=/PASSWORDTOADD="${env.pw_linuxserviceaccount}"/' serviceaccount.sh