chore: updating some more things
This commit is contained in:
@@ -20,7 +20,10 @@ import { TemplateEntityV1alpha1 } from '@backstage/catalog-model';
|
||||
import { parseLocationAnnotation } from '../helpers';
|
||||
import { InputError, Git } from '@backstage/backend-common';
|
||||
import { PreparerBase, PreparerOptions } from './types';
|
||||
import { readBitbucketIntegrationConfigs, BitbucketIntegrationConfig } from '@backstage/integration';
|
||||
import {
|
||||
readBitbucketIntegrationConfigs,
|
||||
BitbucketIntegrationConfig,
|
||||
} from '@backstage/integration';
|
||||
import GitUriParser from 'git-url-parse';
|
||||
import { Config } from '@backstage/config';
|
||||
import { Logger } from 'winston';
|
||||
@@ -29,16 +32,29 @@ export class BitbucketPreparer implements PreparerBase {
|
||||
private readonly privateToken: string;
|
||||
private readonly username: string;
|
||||
private readonly logger: Logger;
|
||||
private readonly integrations: BitbucketIntegrationConfig[];
|
||||
constructor(config: Config, { logger }: { logger: Logger}) {
|
||||
private readonly integrations: BitbucketIntegrationConfig[];
|
||||
constructor(config: Config, { logger }: { logger: Logger }) {
|
||||
this.logger = logger;
|
||||
this.integrations = readBitbucketIntegrationConfigs(
|
||||
config.getOptionalConfigArray('integrations.bitbucket') ??Takj
|
||||
)
|
||||
config.getOptionalConfigArray('integrations.bitbucket') ?? [],
|
||||
);
|
||||
|
||||
if (!this.integrations.length) {
|
||||
this.logger.warn(
|
||||
'Integrations for BitBucket in Scaffolder are not set. This will cause errors in a future release. Please migrate to using integrations config and specifying tokens under hostnames',
|
||||
);
|
||||
}
|
||||
|
||||
this.username =
|
||||
config.getOptionalString('scaffolder.bitbucket.api.username') ?? '';
|
||||
this.privateToken =
|
||||
config.getOptionalString('scaffolder.bitbucket.api.token') ?? '';
|
||||
|
||||
if (this.username || this.privateToken) {
|
||||
this.logger.warn(
|
||||
"DEPRECATION: Using the token format under 'scaffolder.github.token' will not be respected in future releases. Please consider using integrations config instead",
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
async prepare(
|
||||
|
||||
@@ -39,7 +39,7 @@ export async function initRepoAndPush({
|
||||
dir,
|
||||
});
|
||||
|
||||
const paths = await globby(['./**', './**/.*'], {
|
||||
const paths = await globby(['./**', './**/.*', '!.git'], {
|
||||
cwd: dir,
|
||||
gitignore: true,
|
||||
dot: true,
|
||||
|
||||
Reference in New Issue
Block a user