From 48e8a6b2ad1f94fdd981a49e3cf1a0608dddb847 Mon Sep 17 00:00:00 2001 From: Samiya Akhtar Date: Thu, 9 Apr 2020 09:18:43 -0700 Subject: [PATCH 1/2] Part two of getting service display name --- src/lib/fileutils.ts | 9 ++++----- src/test/mockFactory.ts | 9 ++++----- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/lib/fileutils.ts b/src/lib/fileutils.ts index 8dfdf861a..5fcf1235a 100644 --- a/src/lib/fileutils.ts +++ b/src/lib/fileutils.ts @@ -195,17 +195,16 @@ export const serviceBuildAndUpdatePipeline = ( }, { script: generateYamlScript([ + `. ./build.sh --source-only`, + `get_spk_version`, + `download_spk`, `export BUILD_REPO_NAME=${BUILD_REPO_NAME(serviceName)}`, `tag_name="$BUILD_REPO_NAME:${IMAGE_TAG}"`, `commitId=$(Build.SourceVersion)`, `commitId=$(echo "\${commitId:0:7}")`, - `service=$(Build.Repository.Name)`, - `service=\${service##*/}`, + `service=$(./spk/spk service get-display-name -p ${relativeServiceForDockerfile})`, `url=$(git remote --verbose | grep origin | grep fetch | cut -f2 | cut -d' ' -f1)`, `repourl=\${url##*@}`, - `. ./build.sh --source-only`, - `get_spk_version`, - `download_spk`, `./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`, ]), displayName: diff --git a/src/test/mockFactory.ts b/src/test/mockFactory.ts index aa0a883ab..52e37884b 100644 --- a/src/test/mockFactory.ts +++ b/src/test/mockFactory.ts @@ -75,17 +75,16 @@ export const createTestServiceBuildAndUpdatePipelineYaml = ( }, { script: generateYamlScript([ + `. ./build.sh --source-only`, + `get_spk_version`, + `download_spk`, `export BUILD_REPO_NAME=${BUILD_REPO_NAME(serviceName)}`, `tag_name="$BUILD_REPO_NAME:${IMAGE_TAG}"`, `commitId=$(Build.SourceVersion)`, `commitId=$(echo "\${commitId:0:7}")`, - `service=$(Build.Repository.Name)`, - `service=\${service##*/}`, + `service=$(./spk/spk service get-display-name -p ${relativeServiceForDockerfile})`, `url=$(git remote --verbose | grep origin | grep fetch | cut -f2 | cut -d' ' -f1)`, `repourl=\${url##*@}`, - `. ./build.sh --source-only`, - `get_spk_version`, - `download_spk`, `./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`, ]), displayName: From bdb1da3eeaa8ea4e70c757b8087752c8edf72d10 Mon Sep 17 00:00:00 2001 From: Samiya Akhtar Date: Thu, 9 Apr 2020 09:25:45 -0700 Subject: [PATCH 2/2] Update README for tests --- tests/README.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/README.md b/tests/README.md index b6e03ba92..b21998f84 100644 --- a/tests/README.md +++ b/tests/README.md @@ -33,7 +33,8 @@ data, set up a Logic App to delete it. You can use the template for this. Edit the values in `parameters` and fill in your `` and `resource group` where the storage account is. -To check existing Logic Apps in your subscription, go to the [portal.azure.com](http://portal.azure.com) and search for Logic Apps. +To check existing Logic Apps in your subscription, go to the +[portal.azure.com](http://portal.azure.com) and search for Logic Apps. # Scenarios Exercised So Far @@ -84,11 +85,11 @@ To check existing Logic Apps in your subscription, go to the [portal.azure.com]( | Command | Coverage | | ------------------------ | -------- | -| spk deployment get | 🚫 | +| spk deployment get | ✅ | | spk deployment onboard | ✅ | | spk deployment validate | 🚫 | | spk deployment dashboard | 🚫 | -| spk deployment create | 🚫 | +| spk deployment create | ✅ | ## Infrastructure Management