From 7174842cfadec4f2a3be9fcfbad2f5fc2fd9d14b Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Fri, 5 Jul 2024 11:08:44 +0200 Subject: [PATCH] ci: refs #7643 Reprepro SSH credentials --- Jenkinsfile | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 4c723a1f..07bc6031 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -40,7 +40,7 @@ pipeline { sh 'mkdir -p output' sh 'mv ../*.deb ../*.build ../*.buildinfo ../*.changes output' - stash includes: 'output/*.deb', name: 'debPackage' + stash includes: 'output', name: 'debuildOutput' } } stage('Reprepro') { @@ -51,16 +51,19 @@ pipeline { } } steps { - unstash 'debPackage' + unstash 'debuildOutput' + debFile = sh(script: 'ls output/*.deb', returnStdout: true).trim() - script { + withCredentials([sshUserPrivateKey( + credentialsId: 'jenkins-agent', + usernameVariable: 'user' + keyFileVariable: 'identityFile' + )]) { remote.name = 'reprepro' remote.host = 'reprepro.reprepro' - remote.user = 'root' - remote.identityFile = '/home/jenkins/.ssh/id_ed25519' remote.allowAnyHosts = true - - debFile = sh(script: 'ls output/*.deb', returnStdout: true).trim() + remote.user = user + remote.identityFile = identityFile } sshPut([