Update Jenkinsfile

This commit is contained in:
saisrinisrinivas 2023-07-04 13:36:23 +05:30 committed by GitHub
parent 33ca179331
commit d8678a6383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

34
Jenkinsfile vendored
View file

@ -1,26 +1,20 @@
pipeline {
agent any
stages {
stage('Download and Execute Jenkinsfile') {
steps {
withAWS(region: 'ap-south-1', credentials: 'iamuser1') {
script {
// Download the Jenkinsfile from S3
sh 'aws s3 cp s3://myjenkinsbucket001/Jenkinsfile /tmp/Jenkinsfile'
}
}
script {
def downloadedJenkinsfile = readFile('/tmp/Jenkinsfile')
node {
deleteDir() // Clean workspace before executing downloaded Jenkinsfile
writeFile(file: 'Jenkinsfile', text: downloadedJenkinsfile)
load 'Jenkinsfile'
}
}
stage('Download and Execute Jenkinsfile') {
steps {
// Download the Jenkinsfile from S3
withAWS(region: 'ap-south-1', credentials: 'iamuser1') {
sh 'aws s3 cp s3://myjenkinsbucket001/Jenkinsfile /tmp/Jenkinsfile'
}
script {
def downloadedJenkinsfile = readFile('/tmp/Jenkinsfile')
node {
deleteDir() // Clean workspace before executing downloaded Jenkinsfile
writeFile(file: 'Jenkinsfile', text: downloadedJenkinsfile)
load 'Jenkinsfile'
}
}
}
}