From 518638716297d2b458c6183b31680b2c79d8d8b2 Mon Sep 17 00:00:00 2001 From: Juan Ferrer Toribio Date: Wed, 10 Jul 2024 10:54:47 +0200 Subject: [PATCH] ci: refs #7643 Reprepro debug --- Jenkinsfile | 61 +++++++++-------------------------------------------- 1 file changed, 10 insertions(+), 51 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index e49dcdff..8ca2803e 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -37,70 +37,29 @@ pipeline { } steps { sh 'debuild -us -uc -b' - //sh 'mkdir -p output' - //sh 'mv ../*.deb ../*.build ../*.changes ../*.buildinfo output' script { - def files = findFiles(glob: '../*.changes') - files.each { file -> changesFile = file.name } + def files = findFiles(glob: '../hedera-web_*.changes') + files.each { file -> env.CHANGES_FILE = file.name } } withCredentials([sshUserPrivateKey( credentialsId: 'jenkins-agent', - keyFileVariable: 'keyFile' + keyFileVariable: 'KEY_FILE' )]) { + sh 'eval "$(ssh-agent -s)"' + sh 'ssh-add "$KEY_FILE"' + configFileProvider([ configFile(fileId: "dput.cf", variable: 'DPUT_CONFIG') ]) { - echo changesFile - echo 'dput --config $DPUT_CONFIG verdnatura' - sleep 86400 + echo env.DPUT_CONFIG + echo env.KEY_FILE + echo env.CHANGES_FILE + sh 'dput --config "$DPUT_CONFIG" verdnatura "$CHANGES_FILE"' } } - - //stash includes: 'output/*', name: 'debuildOutput' - } - } - stage('Reprepro') { - when { - anyOf { - branch 'master' - branch 'test' - } - } - environment { - REPREPRO_BASE_DIR = '/var/lib/reprepro/repo' - } - steps { - unstash 'debuildOutput' - script { - def files = findFiles(glob: 'output/*.changes') - files.each { file -> changesFile = file.name } - } - - withCredentials([sshUserPrivateKey( - credentialsId: 'jenkins-agent', - usernameVariable: 'user', - keyFileVariable: 'keyFile' - )]) { - script { - remote.user = user - remote.identityFile = keyFile - remote.name = 'reprepro' - remote.host = 'reprepro.reprepro' - remote.allowAnyHosts = true - } - sshPut([ - remote: remote, - from: "output/$changesFile", - into: "$REPREPRO_BASE_DIR/incoming" - ]) - sshCommand([ - remote: remote, - command: "reprepro processincoming default $changesFile" - ]) - } } } stage('Deploy') {