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

Commit 7ad5325

Browse files
authored
Get service display name using new command in pipeline (#541)
* Part two of getting service display name * Update README for tests
1 parent cc09f24 commit 7ad5325

File tree

3 files changed

+12
-13
lines changed

3 files changed

+12
-13
lines changed

src/lib/fileutils.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -195,17 +195,16 @@ export const serviceBuildAndUpdatePipeline = (
195195
},
196196
{
197197
script: generateYamlScript([
198+
`. ./build.sh --source-only`,
199+
`get_spk_version`,
200+
`download_spk`,
198201
`export BUILD_REPO_NAME=${BUILD_REPO_NAME(serviceName)}`,
199202
`tag_name="$BUILD_REPO_NAME:${IMAGE_TAG}"`,
200203
`commitId=$(Build.SourceVersion)`,
201204
`commitId=$(echo "\${commitId:0:7}")`,
202-
`service=$(Build.Repository.Name)`,
203-
`service=\${service##*/}`,
205+
`service=$(./spk/spk service get-display-name -p ${relativeServiceForDockerfile})`,
204206
`url=$(git remote --verbose | grep origin | grep fetch | cut -f2 | cut -d' ' -f1)`,
205207
`repourl=\${url##*@}`,
206-
`. ./build.sh --source-only`,
207-
`get_spk_version`,
208-
`download_spk`,
209208
`./spk/spk deployment create -n $(INTROSPECTION_ACCOUNT_NAME) -k $(INTROSPECTION_ACCOUNT_KEY) -t $(INTROSPECTION_TABLE_NAME) -p $(INTROSPECTION_PARTITION_KEY) --p1 $(Build.BuildId) --image-tag $tag_name --commit-id $commitId --service $service --repository $repourl`,
210209
]),
211210
displayName:

src/test/mockFactory.ts

+4-5
Original file line numberDiff line numberDiff line change
@@ -75,17 +75,16 @@ export const createTestServiceBuildAndUpdatePipelineYaml = (
7575
},
7676
{
7777
script: generateYamlScript([
78+
`. ./build.sh --source-only`,
79+
`get_spk_version`,
80+
`download_spk`,
7881
`export BUILD_REPO_NAME=${BUILD_REPO_NAME(serviceName)}`,
7982
`tag_name="$BUILD_REPO_NAME:${IMAGE_TAG}"`,
8083
`commitId=$(Build.SourceVersion)`,
8184
`commitId=$(echo "\${commitId:0:7}")`,
82-
`service=$(Build.Repository.Name)`,
83-
`service=\${service##*/}`,
85+
`service=$(./spk/spk service get-display-name -p ${relativeServiceForDockerfile})`,
8486
`url=$(git remote --verbose | grep origin | grep fetch | cut -f2 | cut -d' ' -f1)`,
8587
`repourl=\${url##*@}`,
86-
`. ./build.sh --source-only`,
87-
`get_spk_version`,
88-
`download_spk`,
8988
`./spk/spk deployment create -n $(INTROSPECTION_ACCOUNT_NAME) -k $(INTROSPECTION_ACCOUNT_KEY) -t $(INTROSPECTION_TABLE_NAME) -p $(INTROSPECTION_PARTITION_KEY) --p1 $(Build.BuildId) --image-tag $tag_name --commit-id $commitId --service $service --repository $repourl`,
9089
]),
9190
displayName:

tests/README.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ data, set up a Logic App to delete it. You can use the template
3333
for this. Edit the values in `parameters` and fill in your `<subscription id>`
3434
and `resource group` where the storage account is.
3535

36-
To check existing Logic Apps in your subscription, go to the [portal.azure.com](http://portal.azure.com) and search for Logic Apps.
36+
To check existing Logic Apps in your subscription, go to the
37+
[portal.azure.com](http://portal.azure.com) and search for Logic Apps.
3738

3839
# Scenarios Exercised So Far
3940

@@ -84,11 +85,11 @@ To check existing Logic Apps in your subscription, go to the [portal.azure.com](
8485

8586
| Command | Coverage |
8687
| ------------------------ | -------- |
87-
| spk deployment get | 🚫 |
88+
| spk deployment get | |
8889
| spk deployment onboard ||
8990
| spk deployment validate | 🚫 |
9091
| spk deployment dashboard | 🚫 |
91-
| spk deployment create | 🚫 |
92+
| spk deployment create | |
9293

9394
## Infrastructure Management
9495

0 commit comments

Comments
 (0)