Skip to content

Commit e2d54a6

Browse files
Optionally skip initial sync from s3
1 parent d8c217d commit e2d54a6

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@ The script pulls yuidoc build output from all Ember versions from Amazon S3, con
2424

2525

2626
## To Generate docs for a specific project and/or version for development
27-
You can do this by passing `--project ember/ember-data --version 2.11.1` as an argument to the index script. e.g., `yarn start -- --project ember --version 2.11.0`
27+
You can do this by passing `--project ember/ember-data --version 2.11.1` as an argument to the index script. e.g., `yarn start -- --project ember --version 2.11.0`.
28+
Setting `export SKIP_S3_SYNC=yes` will stop the generator from syncing existing docs from s3 in the beginning.

lib/s3-sync.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ http.globalAgent.maxSockets = https.globalAgent.maxSockets = 30
1212
const {
1313
AWS_ACCESS_KEY,
1414
AWS_SECRET_KEY,
15-
AWS_SHOULD_PUBLISH
15+
AWS_SHOULD_PUBLISH,
16+
SKIP_S3_SYNC
1617
} = process.env
1718

1819
const client = S3.createClient({
@@ -68,13 +69,17 @@ const downloadDir = (options, docName) => syncDir('download', options, docName)
6869
const uploadDir = (options, docName) => syncDir('upload', options, docName)
6970

7071
module.exports.syncToLocal = function syncToLocal () {
71-
return downloadDir(s3DocsDirOptions, 's3')
72-
.then(() => downloadDir(jsonDocsDirOptions, 'json'))
72+
if (!SKIP_S3_SYNC) {
73+
return downloadDir(s3DocsDirOptions, 's3')
74+
.then(() => downloadDir(jsonDocsDirOptions, 'json'))
75+
}
76+
return Promise.resolve()
7377
}
7478

7579
module.exports.syncToS3 = function syncToS3 () {
7680
if (AWS_SHOULD_PUBLISH === 'yes') {
7781
return uploadDir(s3DocsDirOptions, 's3')
7882
.then(() => uploadDir(jsonDocsDirOptions, 'json'))
7983
}
84+
return Promise.resolve()
8085
}

0 commit comments

Comments
 (0)