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:
Adrian Kosiński
2024-10-01 19:40:47 +02:00
committed by GitHub
parent 1b05958bb1
commit fbdc63116c
10 changed files with 115 additions and 9 deletions
+9
View File
@@ -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