Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jenkins pipeline s3 file download

I am trying to add a step in jenkins to download from s3

//download file from s3
withAWS(credentials:'credss') { 
  s3Download(file:'test.json', bucket:'test', path:'/devops/test.json',force:true)
}

I am getting this below error

java.lang.NoSuchMethodError: No such DSL method 'withAWS' found among steps

like image 452
Shashank Avatar asked Jan 19 '26 11:01

Shashank


2 Answers

make sure the pipeline: AWS Steps plugin is installed. Add your user AWS credentials to the Jenkins. Make sure the user has the permissions to download the file from S3. Please refer Pipeline: AWS Steps Github for additional syntax's how to integrate AWS services with jenkins pipeline.

pipeline {
agent any
stages {
    stage('S3download') {
      steps {
    withAWS(credentials:'awscredentials') {
        s3Download(file: 'key', bucket: 'test', path: '/home/ubuntu/')
      }
    }
    }
}
}
like image 161
pavan Avatar answered Jan 21 '26 02:01

pavan


pipeline {
  agent any
  stages {
    stage('download') {
        steps {
    withAWS(credentials:'XXXX',region:'XXXXXX') {
          s3Download bucket:'bucketname',file:'toPath', path:'fromPath',force:true
        }
      }
    }
    stage('Done') {
      steps {
        echo "done"
      }
    }
  }
}
like image 29
Munugala Vijay Avatar answered Jan 21 '26 03:01

Munugala Vijay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!