Azure branch support

This commit is contained in:
Alan Crosswell
2021-01-23 17:42:26 -05:00
parent aae1dca6c6
commit ea59a2b363
2 changed files with 5 additions and 1 deletions
@@ -45,7 +45,7 @@ describe('AzurePreparer', () => {
metadata: {
annotations: {
[LOCATION_ANNOTATION]:
'url:https://dev.azure.com/backstage-org/backstage-project/_git/template-repo?path=%2Ftemplate.yaml',
'url:https://dev.azure.com/backstage-org/backstage-project/_git/template-repo?path=%2Ftemplate.yaml&version=GBmaster',
},
name: 'graphql-starter',
title: 'GraphQL Service',
@@ -112,6 +112,7 @@ describe('AzurePreparer', () => {
url:
'https://dev.azure.com/backstage-org/backstage-project/_git/template-repo',
dir: expect.any(String),
ref: 'master',
});
});
@@ -124,6 +125,7 @@ describe('AzurePreparer', () => {
url:
'https://dev.azure.com/backstage-org/backstage-project/_git/template-repo',
dir: expect.any(String),
ref: 'master',
});
});
@@ -42,6 +42,7 @@ export class AzurePreparer implements PreparerBase {
const parsedGitLocation = parseGitUrl(location);
const repositoryCheckoutUrl = parsedGitLocation.toString('https');
const ref = parsedGitLocation.ref;
const tempDir = await fs.promises.mkdtemp(
path.join(workingDirectory, templateId),
);
@@ -63,6 +64,7 @@ export class AzurePreparer implements PreparerBase {
await git.clone({
url: repositoryCheckoutUrl,
ref: ref,
dir: tempDir,
});