From b426d7a5348f6cd4b15d5dd40d2f41d9cfb0ec2f Mon Sep 17 00:00:00 2001
From: "gioacchino.vino" <gioacchino.vino@infn.it>
Date: Thu, 21 Sep 2023 17:23:57 +0200
Subject: [PATCH] Updated oidc-agent account

---
 utils/Jenkinsfile | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/utils/Jenkinsfile b/utils/Jenkinsfile
index 94395ef..47f4966 100644
--- a/utils/Jenkinsfile
+++ b/utils/Jenkinsfile
@@ -11,8 +11,10 @@ pipeline {
         stage ('Create test deployment'){
             steps {
                 sh '''#!/bin/bash
-                      wget -O site.yaml "${PLAYBOOK_URL}"
-                      ansible-playbook site.yaml --extra-vars "paas_ci_test_step='create_deployment'"  
+                    eval `oidc-agent-service use`
+                    oidc-add infn-cloud-ops --pw-env=PASS
+                    wget -O site.yaml "${PLAYBOOK_URL}"
+                    ansible-playbook site.yaml --extra-vars "paas_ci_test_step='create_deployment'"  
                 '''
             }
         }        
@@ -23,8 +25,10 @@ pipeline {
                     usernamePassword(credentialsId: "jenkins_scans_creds", usernameVariable: 'GMP_USER', passwordVariable: 'GMP_PASSWORD')
                 ]) {
                     sh '''#!/bin/bash
-                          cp ${keyfile} /home/jenkins/.ssh/id_rsa
-                          ansible-playbook site.yaml --extra-vars "paas_ci_test_step='scan'"  
+                        eval `oidc-agent-service use`
+                        oidc-add infn-cloud-ops --pw-env=PASS
+                        cp ${keyfile} /home/jenkins/.ssh/id_rsa
+                        ansible-playbook site.yaml --extra-vars "paas_ci_test_step='scan'"  
                     '''
                 }
             }
@@ -39,6 +43,8 @@ pipeline {
     post { 
         always { 
             sh '''#!/bin/bash
+            eval `oidc-agent-service use`
+            oidc-add infn-cloud-ops --pw-env=PASS
             ansible-playbook site.yaml --extra-vars "paas_ci_test_step='clean'" 
             '''
         }
-- 
GitLab