Skip to content

Commit 2126fb2

Browse files
author
Denys Zhuravel
committed
use the multipart upload for all the files, since the normal one doesn't work: aws/aws-sdk-java-v2#953
1 parent ca0656d commit 2126fb2

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/main/java/albelli/cloudgradle/runtime/AmazonCodeBuildScheduler.kt

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,18 +144,12 @@ class AmazonCodeBuildScheduler(private val settings: CloudGradleProperties) {
144144
val jarPath = Paths.get(job.jarPath)
145145
val jarFileName = jarPath.fileName.toString()
146146

147-
s3.multipartUploadFile(settings.cloudGradleOptions.bucketName, targetDirectory + jarFileName, job.jarPath, 5)
148-
149147
for (feature in job.featurePaths) {
150-
val putFeatureRequest = PutObjectRequest
151-
.builder()
152-
.bucket(settings.cloudGradleOptions.bucketName)
153-
.key(targetDirectory + feature)
154-
.build()
155-
156-
s3.putObject(putFeatureRequest, Paths.get(feature))
148+
s3.multipartUploadFile(settings.cloudGradleOptions.bucketName, targetDirectory + feature, feature, 5)
157149
}
158150

151+
s3.multipartUploadFile(settings.cloudGradleOptions.bucketName, targetDirectory + jarFileName, job.jarPath, 5)
152+
159153
return targetDirectory
160154
}
161155

0 commit comments

Comments
 (0)