Added alpha support for new backend system

Signed-off-by: Andre Wanlin <67169551+awanlin@users.noreply.github.com>
This commit is contained in:
Andre Wanlin
2023-06-16 17:24:23 -05:00
parent cb91dac435
commit ae261e79d2
19 changed files with 479 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
/*
* Copyright 2023 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 { azureDevOpsPlugin } from './plugin';
@@ -0,0 +1,50 @@
/*
* Copyright 2023 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 { loggerToWinstonLogger } from '@backstage/backend-common';
import {
coreServices,
createBackendPlugin,
} from '@backstage/backend-plugin-api';
import { createRouter } from './service/router';
/**
* Azure DevOps backend plugin
*
* @alpha
*/
export const azureDevOpsPlugin = createBackendPlugin({
pluginId: 'azure-devops',
register(env) {
env.registerInit({
deps: {
config: coreServices.config,
logger: coreServices.logger,
reader: coreServices.urlReader,
httpRouter: coreServices.httpRouter,
},
async init({ config, logger, reader, httpRouter }) {
httpRouter.use(
await createRouter({
config,
logger: loggerToWinstonLogger(logger),
reader,
}),
);
},
});
},
});