Signed-off-by: bnechyporenko <bnechyporenko@bol.com>
This commit is contained in:
bnechyporenko
2024-06-16 10:15:20 +02:00
committed by blam
parent f61f26d608
commit c1ce175011
3 changed files with 29 additions and 3 deletions
+25
View File
@@ -0,0 +1,25 @@
/*
* Copyright 2020 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export interface Config {
/** Configuration options for the scaffolder plugin */
scaffolder?: {
/**
* Sets GCP bucket name to store serialized workspace for scaffolder tasks.
*/
EXPERIMENTAL_workspaceSerializationGcpBucketName?: string;
};
}
@@ -30,7 +30,8 @@
}
},
"files": [
"dist"
"dist",
"config.d.ts"
],
"scripts": {
"build": "backstage-cli package build",
@@ -87,11 +87,11 @@ export class GcpBucketWorkspaceProvider implements WorkspaceProvider {
private getGcpBucketName(): string {
const bucketName = this.config?.getOptionalString(
'scaffolder.EXPERIMENTAL_gcpBucketName',
'scaffolder.EXPERIMENTAL_workspaceSerializationGcpBucketName',
);
if (!bucketName) {
throw new Error(
`You've missed to configure scaffolder.EXPERIMENTAL_gcpBucketName in app-config.yaml file`,
`You've missed to configure scaffolder.EXPERIMENTAL_workspaceSerializationGcpBucketName in app-config.yaml file`,
);
}
return bucketName;