From e3c6e18293bc33ab28a837e69f66ff1045412f19 Mon Sep 17 00:00:00 2001
From: "gioacchino.vino" <gioacchino.vino@infn.it>
Date: Mon, 4 Dec 2023 15:50:06 +0100
Subject: [PATCH] Update agent label

---
 jenkinsfile/Jenkinsfile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/jenkinsfile/Jenkinsfile b/jenkinsfile/Jenkinsfile
index 0bfe6f6..84003af 100644
--- a/jenkinsfile/Jenkinsfile
+++ b/jenkinsfile/Jenkinsfile
@@ -1,5 +1,5 @@
 pipeline {
-    agent { label 'docker-agent' } 
+    agent { label 'docker-paas-agent' }
     
     environment {
         ORCHENT_AGENT_ACCOUNT='infn-cloud-ops'
@@ -10,6 +10,7 @@ pipeline {
         stage ('Test environment'){
             steps {
                 withCredentials([
+                    sshUserPrivateKey(credentialsId: "ssh_scans", keyFileVariable: 'keyfile'),
                     usernamePassword(credentialsId: "jenkins_scans_creds", usernameVariable: 'GMP_USER', passwordVariable: 'GMP_PASSWORD')
                 ]) {
                     sh '''#!/bin/bash
@@ -31,10 +32,10 @@ pipeline {
                         fi
 
                         # Create ssh tunnel
+                        cp ${keyfile} /home/jenkins/.ssh/id_rsa
                         ssh -o StrictHostKeyChecking=no -f -N -L localhost:9390:192.168.235.234:9390 jenkins@scans.cloud.infn.it 
 
                         # Greenbone connection test
-                        #/var/lib/jenkins/.local/bin/gvm-cli --gmp-username $GMP_USER --gmp-password $GMP_PASSWORD tls --hostname 127.0.0.1 --xml "<get_version/>" > gvm.output
                         /usr/local/bin/gvm-cli --gmp-username $GMP_USER --gmp-password $GMP_PASSWORD tls --hostname 127.0.0.1 --xml "<get_version/>" > gvm.output
                         if grep -q OK gvm.output
                         then 
-- 
GitLab