Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOP-4831: Save Lighthouse HTML reports to S3 (rather than Atlas) #84

Merged
merged 28 commits into from
Jul 22, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
packaged with s3
  • Loading branch information
mmeigs committed Jul 16, 2024
commit 9f1d4284a493c1d040e972cc679c9afc2c2b051b
29 changes: 15 additions & 14 deletions dist/upload-lighthouse/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions src/upload-lighthouse/index.ts
Original file line number Diff line number Diff line change
@@ -47,19 +47,19 @@ async function upload(
const urlWithDashes = urlWithoutType.split(/\/\?|\//).join('-');
const destinationDir = `/${reportType}/${commitHash}/${urlWithDashes}/${type}`;

// const uploads = htmlRuns.map(async (htmlReport, i) => {
// const key = `${destinationDir}/${i + 1}.html`;
// const input = {
// Body: createReadStream(htmlReport),
// Key: key,
// Bucket: awsBucket,
// ContentType: 'text/html',
// CacheControl: 'no-cache',
// };
// const command = new PutObjectCommand(input);
// return client.send(command);
// });
// return Promise.all(uploads);
const uploads = htmlRuns.map(async (htmlReport, i) => {
const key = `${destinationDir}/${i + 1}.html`;
const input = {
Body: createReadStream(htmlReport),
Key: key,
Bucket: awsBucket,
ContentType: 'text/html',
CacheControl: 'no-cache',
};
const command = new PutObjectCommand(input);
return client.send(command);
});
return Promise.all(uploads);
}

const fetchOneDocument = async () => {