feat(techdocs): Allow to pass options to GCS publisher (#26836)
* feat(techdocs): Allow to pass options to GCS publisher Signed-off-by: Adrian Kosinski <adrian.kosinski@allegro.com> --------- Signed-off-by: Adrian Kosinski <adrian.kosinski@allegro.com>
This commit is contained in:
@@ -29,6 +29,7 @@ import {
|
||||
Preparers,
|
||||
Publisher,
|
||||
PublisherBase,
|
||||
PublisherSettings,
|
||||
PublisherType,
|
||||
RemoteProtocol,
|
||||
techdocsBuildsExtensionPoint,
|
||||
@@ -89,6 +90,7 @@ export const techdocsPlugin = createBackendPlugin({
|
||||
});
|
||||
|
||||
let customTechdocsPublisher: PublisherBase | undefined;
|
||||
const publisherSettings: PublisherSettings = {};
|
||||
env.registerExtensionPoint(techdocsPublisherExtensionPoint, {
|
||||
registerPublisher(type: PublisherType, publisher: PublisherBase) {
|
||||
if (customTechdocsPublisher) {
|
||||
@@ -96,6 +98,12 @@ export const techdocsPlugin = createBackendPlugin({
|
||||
}
|
||||
customTechdocsPublisher = publisher;
|
||||
},
|
||||
registerPublisherSettings<T extends keyof PublisherSettings>(
|
||||
publisher: T,
|
||||
settings: PublisherSettings[T],
|
||||
) {
|
||||
publisherSettings[publisher] = settings;
|
||||
},
|
||||
});
|
||||
|
||||
env.registerInit({
|
||||
@@ -144,6 +152,7 @@ export const techdocsPlugin = createBackendPlugin({
|
||||
logger: winstonLogger,
|
||||
discovery: discovery,
|
||||
customPublisher: customTechdocsPublisher,
|
||||
publisherSettings,
|
||||
});
|
||||
|
||||
// checks if the publisher is working and logs the result
|
||||
|
||||
Reference in New Issue
Block a user