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([