deploy: configure NC01 HWLAB monitor exposure
This commit is contained in:
@@ -716,16 +716,17 @@ export function readTextFile(path: string): string {
|
||||
return readFileSync(path, "utf8");
|
||||
}
|
||||
|
||||
export function readEnvSourceFile(params: { root: string; sourceRef: string; missingMessage?: (sourcePath: string) => string }): EnvSourceFileMaterial {
|
||||
export function readEnvSourceFile(params: { root: string; sourceRef: string; rawKey?: string; missingMessage?: (sourcePath: string) => string }): EnvSourceFileMaterial {
|
||||
const sourcePath = join(params.root, params.sourceRef);
|
||||
if (!existsSync(sourcePath)) {
|
||||
throw new Error(params.missingMessage?.(sourcePath) ?? `required secret source ${redactRepoPath(sourcePath)} is missing`);
|
||||
}
|
||||
const text = readFileSync(sourcePath, "utf8");
|
||||
return {
|
||||
sourceRef: params.sourceRef,
|
||||
sourcePath,
|
||||
sourcePathRedacted: redactRepoPath(sourcePath),
|
||||
values: parseEnvFile(readFileSync(sourcePath, "utf8")),
|
||||
values: params.rawKey === undefined ? parseEnvFile(text) : { [params.rawKey]: text.trim() },
|
||||
valuesPrinted: false,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user