Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit 51648b2

Browse files
authored
Fix broken in pipeline (#418)
1 parent e6eba57 commit 51648b2

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

src/lib/fileutils.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,9 @@ export const serviceBuildAndUpdatePipeline = (
136136
variableGroups?: string[]
137137
): AzurePipelinesYaml => {
138138
const relativeServicePathFormatted = sanitizeTriggerPath(relServicePath);
139+
const relativeServiceForDockerfile = relServicePath.startsWith("./")
140+
? relServicePath
141+
: "./" + relServicePath;
139142

140143
const pipelineYaml: AzurePipelinesYaml = {
141144
trigger: {
@@ -206,7 +209,7 @@ export const serviceBuildAndUpdatePipeline = (
206209
`export IMAGE_TAG=${IMAGE_TAG}`,
207210
`export IMAGE_NAME=$BUILD_REPO_NAME:$IMAGE_TAG`,
208211
`echo "Image Name: $IMAGE_NAME"`,
209-
`cd ${relativeServicePathFormatted}`,
212+
`cd ${relativeServiceForDockerfile}`,
210213
`echo "az acr build -r $(ACR_NAME) --image $IMAGE_NAME ."`,
211214
`az acr build -r $(ACR_NAME) --image $IMAGE_NAME .`
212215
]),

src/test/mockFactory.ts

+7-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ export const createTestServiceBuildAndUpdatePipelineYaml = (
2323
ringBranches: string[] = ["master", "qa", "test"],
2424
variableGroups: string[] = []
2525
): AzurePipelinesYaml | string => {
26+
const relativeServiceForDockerfile = relativeServicePathFormatted.startsWith(
27+
"./"
28+
)
29+
? relativeServicePathFormatted
30+
: "./" + relativeServicePathFormatted;
31+
2632
const data: AzurePipelinesYaml = {
2733
trigger: {
2834
branches: { include: ringBranches },
@@ -90,7 +96,7 @@ export const createTestServiceBuildAndUpdatePipelineYaml = (
9096
`export IMAGE_TAG=${IMAGE_TAG}`,
9197
`export IMAGE_NAME=$BUILD_REPO_NAME:$IMAGE_TAG`,
9298
`echo "Image Name: $IMAGE_NAME"`,
93-
`cd ${sanitizeTriggerPath(relativeServicePathFormatted)}`,
99+
`cd ${relativeServiceForDockerfile}`,
94100
`echo "az acr build -r $(ACR_NAME) --image $IMAGE_NAME ."`,
95101
`az acr build -r $(ACR_NAME) --image $IMAGE_NAME .`
96102
]),

0 commit comments

Comments
 (0)