Issue
Can we upload multiple files (not entire folder) to S3 using s3Upload
in Jenkins file?
I was trying to upload all rpm files (*.rpm
) in the root directory to S3 using the s3Upload
function.
Solution
findFiles solved the issue. Below is the snippet used for the same.
files = findFiles(glob: '*.rpm')
files.each {
println "RPM: ${it}"
withAWS(credentials: '****************'){
s3Upload(file:"${it}", bucket:'rpm-repo', path:"${bucket_path}")
}
}
Answered By - rashidcmb