scaffolder-backend: removed the publish:file action

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-08-10 14:21:04 +02:00
parent c971afbf21
commit 2df9955f4a
4 changed files with 5 additions and 71 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend': patch
---
Removed the depreacated `publish:file` action, use the template editor to test templates instead.
-5
View File
@@ -303,11 +303,6 @@ export function createPublishBitbucketServerAction(options: {
token?: string | undefined;
}>;
// @public @deprecated
export function createPublishFileAction(): TemplateAction<{
path: string;
}>;
// @public
export function createPublishGerritAction(options: {
integrations: ScmIntegrationRegistry;
@@ -1,65 +0,0 @@
/*
* Copyright 2021 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.
*/
import fs from 'fs-extra';
import { dirname } from 'path';
import { InputError } from '@backstage/errors';
import { createTemplateAction } from '../../createTemplateAction';
/**
* This task is useful for local development and testing of both the scaffolder
* and scaffolder templates.
*
* @remarks
*
* This action is not installed by default and should not be installed in
* production, as it writes the files to the local filesystem of the scaffolder.
*
* @public
* @deprecated This action will be removed, prefer testing templates using the template editor instead.
*/
export function createPublishFileAction() {
return createTemplateAction<{ path: string }>({
id: 'publish:file',
description: 'Writes contents of the workspace to a local directory',
schema: {
input: {
type: 'object',
required: ['path'],
properties: {
path: {
title: 'Path to a directory where the output will be written',
type: 'string',
},
},
},
},
async handler(ctx) {
ctx.logger.warn(
'[DEPRECATED] This action will be removed, prefer testing templates using the template editor instead.',
);
const { path } = ctx.input;
const exists = await fs.pathExists(path);
if (exists) {
throw new InputError('Output path already exists');
}
await fs.ensureDir(dirname(path));
await fs.copy(ctx.workspacePath, path);
},
});
}
@@ -18,7 +18,6 @@ export { createPublishAzureAction } from './azure';
export { createPublishBitbucketAction } from './bitbucket';
export { createPublishBitbucketCloudAction } from './bitbucketCloud';
export { createPublishBitbucketServerAction } from './bitbucketServer';
export { createPublishFileAction } from './file';
export { createPublishGerritAction } from './gerrit';
export { createPublishGerritReviewAction } from './gerritReview';
export { createPublishGithubAction } from './github';