Merge pull request #321 from daniel-harrison/master

Enable shared config for s3
This commit is contained in:
priyawadhwa 2018-08-27 16:06:22 -07:00 committed by GitHub
commit 3654ea4a02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -35,7 +35,13 @@ type S3 struct {
// UnpackTarFromBuildContext download and untar a file from s3
func (s *S3) UnpackTarFromBuildContext() (string, error) {
bucket, item := util.GetBucketAndItem(s.context)
downloader := s3manager.NewDownloader(session.New())
sess, err := session.NewSessionWithOptions(session.Options{
SharedConfigState: session.SharedConfigEnable,
})
if err != nil {
return bucket, err
}
downloader := s3manager.NewDownloader(sess)
directory := constants.BuildContextDir
tarPath := filepath.Join(directory, constants.ContextTar)
if err := os.MkdirAll(directory, 0750); err != nil {