Skip to content

Commit 93bd1f2

Browse files
Fix upload issues
1 parent 30060b1 commit 93bd1f2

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

lib/s3-sync.js

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import ora from 'ora'
44
import http from 'http'
55
import https from 'https'
66
import humanSize from 'human-size'
7+
import { merge } from 'lodash'
78

89
// To increase s3's download & upload dir perf
910
http.globalAgent.maxSockets = https.globalAgent.maxSockets = 30
@@ -25,29 +26,29 @@ const jsonDocsDirDownloadOptions = {
2526
},
2627
}
2728

28-
const jsonDocsDirUploadOptions = {
29-
localDir: 'tmp/json-docs',
29+
const jsonDocsDirUploadOptions = merge({}, jsonDocsDirDownloadOptions, {
3030
s3Params: {
31-
//ACL: 'public-read',
32-
Bucket: 'api-docs.emberjs.com',
31+
ACL: 'public-read',
3332
CacheControl: 'max-age=365000000, immutable',
3433
GrantRead: 'uri=http://acs.amazonaws.com/groups/global/AllUsers',
35-
//maxRetries: 5,
36-
Prefix: 'json-docs',
3734
},
38-
}
35+
})
3936

40-
const revDocsDirUploadOptions = {
37+
let revDocsDirDownloadOptions = {
4138
localDir: 'tmp/rev-index',
4239
s3Params: {
43-
//ACL: 'public-read',
4440
Bucket: 'api-docs.emberjs.com',
45-
GrantRead: 'uri=http://acs.amazonaws.com/groups/global/AllUsers',
46-
//maxRetries: 5,
4741
Prefix: 'rev-index',
4842
},
4943
}
5044

45+
const revDocsDirUploadOptions = merge({}, revDocsDirDownloadOptions, {
46+
s3Params: {
47+
ACL: 'public-read',
48+
GrantRead: 'uri=http://acs.amazonaws.com/groups/global/AllUsers',
49+
},
50+
})
51+
5152
const syncDir = (operation, options) => {
5253
return new Promise((resolve, reject) => {
5354
let isDownload = operation === 'download'
@@ -75,9 +76,6 @@ const syncDir = (operation, options) => {
7576
}
7677

7778
export function downloadExistingDocsToLocal() {
78-
let revDocsDirDownloadOptions = revDocsDirUploadOptions
79-
delete revDocsDirDownloadOptions.s3Params.GrantRead
80-
8179
return waitForAllPromises([
8280
syncDir('download', jsonDocsDirDownloadOptions),
8381
syncDir('download', revDocsDirDownloadOptions),

0 commit comments

Comments
 (0)