From 2e8d2a002caa744fcfcf2682bfbc73b13cc99f7b Mon Sep 17 00:00:00 2001 From: saisrinisrinivas <102722606+saisrinisrinivas@users.noreply.github.com> Date: Tue, 4 Jul 2023 13:21:58 +0530 Subject: [PATCH] Update Jenkinsfile --- Jenkinsfile | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 72f50c541..214c720c5 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -2,7 +2,7 @@ pipeline { agent any stages { - stage('Download Jenkinsfile') { + stage('Download and Execute Jenkinsfile') { steps { withAWS(region: 'ap-south-1', credentials: 'iamuser1') { script { @@ -10,13 +10,7 @@ pipeline { sh 'aws s3 cp s3://myjenkinsbucket001/Jenkinsfile /tmp/Jenkinsfile' } } - } - } - - stage('Execute Jenkinsfile') { - steps { - // Execute the downloaded Jenkinsfile - script { + script { def downloadedJenkinsfile = readFile('/tmp/Jenkinsfile') node { deleteDir() // Clean workspace before executing downloaded Jenkinsfile @@ -24,8 +18,8 @@ pipeline { load 'Jenkinsfile' } } - } - } + } } - +} +}