Add uploading to internal cloud storage

Summary:
Design doc: https://docs.google.com/document/d/1HLCFl46RfqG0o1mSt8SWrwf_HMfOCRg_oENioc1rkvQ/edit#

We'll use it in the subsequent diff to automatically upload a universal export

Reviewed By: passy

Differential Revision: D40585810

fbshipit-source-id: 5b409d716c2ead040865130d379d4f593cb68483
This commit is contained in:
Andrey Goncharov
2022-10-25 05:31:48 -07:00
committed by Facebook GitHub Bot
parent 5d921966fb
commit 970c03d942
3 changed files with 26 additions and 0 deletions

View File

@@ -55,6 +55,7 @@ import {assertNotNull} from './comms/Utilities';
import {mkdirp} from 'fs-extra';
import {flipperDataFolder, flipperSettingsFolder} from './utils/paths';
import {DebuggableDevice} from './devices/DebuggableDevice';
import {jfUpload} from './fb-stubs/jf';
const {access, copyFile, mkdir, unlink, stat, readlink, readFile, writeFile} =
promises;
@@ -535,6 +536,13 @@ export class FlipperServerImpl implements FlipperServer {
return internGraphGETAPIRequest(endpoint, params, options, token);
},
'intern-upload-scribe-logs': sendScribeLogs,
'intern-cloud-upload': async (path) => {
const uploadRes = await jfUpload(path);
if (!uploadRes) {
throw new Error('Upload failed');
}
return uploadRes;
},
shutdown: async () => {
process.exit(0);
},