add MinIO tests (#381)

Extends workflow to test snapshots with minio.
This commit is contained in:
Paul Fitzpatrick
2022-12-22 12:58:39 -05:00
committed by GitHub
parent 506f61838a
commit 103ebbb045
5 changed files with 1048 additions and 3 deletions

View File

@@ -30,6 +30,7 @@ export interface ICreate {
// Return a string containing 1 or more HTML tags to insert into the head element of every
// static page.
getExtraHeadHtml?(): string;
getStorageOptions?(name: string): ICreateStorageOptions|undefined;
}
export interface ICreateActiveDocOptions {
@@ -40,6 +41,7 @@ export interface ICreateActiveDocOptions {
}
export interface ICreateStorageOptions {
name: string;
check(): boolean;
create(purpose: 'doc'|'meta', extraPrefix: string): ExternalStorage|undefined;
}
@@ -117,5 +119,8 @@ export function makeSimpleCreator(opts: {
elements.push(getThemeBackgroundSnippet());
return elements.join('\n');
},
getStorageOptions(name: string) {
return storage?.find(s => s.name === name);
}
};
}

View File

@@ -37,9 +37,11 @@ export function checkMinIOExternalStorage() {
}).getAsBool();
const accessKey = settings.flag('accessKey').requireString({
envVar: ['GRIST_DOCS_MINIO_ACCESS_KEY'],
censor: true,
});
const secretKey = settings.flag('secretKey').requireString({
envVar: ['GRIST_DOCS_MINIO_SECRET_KEY'],
censor: true,
});
settings.flag('url').set(`minio://${bucket}/${prefix}`);
settings.flag('active').set(true);