From d6b26d2c95e264adda644c8cb273f361e31b2236 Mon Sep 17 00:00:00 2001 From: blam Date: Fri, 3 Jul 2020 05:26:03 +0200 Subject: [PATCH] chore(scaffolder): some more docs for the PR --- .../src/scaffolder/jobs/logger.test.ts | 1 + .../src/scaffolder/stages/templater/types.ts | 19 ++++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/jobs/logger.test.ts b/plugins/scaffolder-backend/src/scaffolder/jobs/logger.test.ts index 5905d26ebb..12f893c146 100644 --- a/plugins/scaffolder-backend/src/scaffolder/jobs/logger.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/jobs/logger.test.ts @@ -14,6 +14,7 @@ * limitations under the License. */ import { makeLogStream } from './logger'; + describe('Logger', () => { const mockMeta = { test: 'blob' }; diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/templater/types.ts b/plugins/scaffolder-backend/src/scaffolder/stages/templater/types.ts index cdefa7821e..519c24e381 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/templater/types.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/templater/types.ts @@ -18,11 +18,28 @@ import type { Writable } from 'stream'; import Docker from 'dockerode'; import { JsonValue } from '@backstage/config'; +/** + * Currently the required template values. The owner + * and where to store the result from templating + */ export type RequiredTemplateValues = { owner: string; storePath: string; }; +/** + * The returned directory from the templater which is ready + * to pass to the next stage of the scaffolder which is publishing + */ +export type TemplaterRunResult = { + resultDir: string; +}; + +/** + * The values that the templater will recieve. The directory of the + * skeleton, with the values from the frontend. A dedicated log stream and a docker + * client to run any templater on top of your directory. + */ export type TemplaterRunOptions = { directory: string; values: RequiredTemplateValues & Record; @@ -32,7 +49,7 @@ export type TemplaterRunOptions = { export type TemplaterBase = { // runs the templating with the values and returns the directory to push the VCS - run(opts: TemplaterRunOptions): Promise; + run(opts: TemplaterRunOptions): Promise; }; export type TemplaterConfig = {