From 32ebf28075204ee5d9c0fc59c64e47bb02967b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Perdomo?= Date: Thu, 16 Nov 2023 15:14:40 +0100 Subject: [PATCH] IM-204 Move sshPut to `script` section --- Jenkinsfile | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2ede831ed..80d414289 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -1,10 +1,5 @@ #!/usr/bin/env groovy -def remote = [:] -remote.name = "im-communication" -remote.host = "192.168.250.200" -remote.allowAnyHosts = true - pipeline { agent { label 'maven-3-9-5-eclipse-temurin-21' @@ -14,10 +9,14 @@ pipeline { steps { sh 'mvn -B -U clean package' sh 'mvn -B --projects klab.core.api javadoc:javadoc' - withCredentials([sshUserPrivateKey(credentialsId: 'jenkins-im-communication', keyFileVariable: 'identity', passphraseVariable: '', usernameVariable: 'ubuntu')]) { - remote.user = userName - remote.identityFile = identity - stage("Copy Javadocs") { + script { + def remote = [:] + remote.name = "im-communication" + remote.host = "192.168.250.200" + remote.allowAnyHosts = true + withCredentials([sshUserPrivateKey(credentialsId: 'jenkins-im-communication', keyFileVariable: 'identity')]) { + remote.user = 'ubuntu' + remote.identityFile = identity sshPut remote: remote, from: 'klab.core.api/target/site/apidocs/', into: '/home/ubuntu/repos/documents.production.compose/javadocs' } }