add a fix for APK content type

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2018-10-12 09:15:30 -04:00
parent 211e39bb5f
commit 33cf6dfd4b
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 7 additions and 0 deletions

View File

@ -101,6 +101,12 @@ def uploadArtifact(path) {
if (getBuildType() == 'pr') {
bucket = 'status-im-prs'
}
/* WARNING: s3cmd can't guess APK MIME content-type */
def customOpts = ''
if (path.endsWith('apk')) {
customOpts += "--mime-type='application/vnd.android.package-archive'"
}
/* We also need credentials for the upload */
withCredentials([usernamePassword(
credentialsId: 'digital-ocean-access-keys',
usernameVariable: 'DO_ACCESS_KEY',
@ -109,6 +115,7 @@ def uploadArtifact(path) {
sh """
s3cmd \\
--acl-public \\
${customOpts} \\
--host='${domain}' \\
--host-bucket='%(bucket)s.${domain}' \\
--access_key=${DO_ACCESS_KEY} \\