diff --git a/docs/commands/data.json b/docs/commands/data.json index d37cf480..72ee99a7 100644 --- a/docs/commands/data.json +++ b/docs/commands/data.json @@ -95,7 +95,7 @@ "description": "URL of the repository (SRC, HLD, Manifest)" } ], - "markdown": "## Description\n\nThis command inserts data about pipeline runs into Azure Table storage.\n\n## Example\n\nThe following command has parameters for Azure Table storage credential and\nvarious pipelines run details.\n\n```\nspk deployment create -n $AZURE_STORAGE_ACCOUNT_NAME \\\n -k $AZURE_ACCOUNT_KEY \\\n -t $AZURE_TABLE_NAME \\\n -p $AZURE_TABLE_PARTITION_KEY \\\n --p2 $(Build.BuildId) \\\n --hld-commit-id $latest_commit \\\n --env $(Build.SourceBranchName) \\\n --image-tag $tag_name \\\n --pr $pr_id \\\n --repository $repourl\n```\n" + "markdown": "## Description\n\nThis command inserts data about pipeline runs into Azure Table storage.\n\n## Example\n\nThe following command has parameters for Azure Table storage credential and various pipelines run details. It's used by the source build pipeline, the release stage and the manifest generation pipeline, and each of them pass in parameters depending on the information for that pipeline. Here are three examples: \n\n```\nspk deployment create -n $AZURE_STORAGE_ACCOUNT_NAME \\\n -k $AZURE_ACCOUNT_KEY \\\n -t $AZURE_TABLE_NAME \\\n -p $AZURE_TABLE_PARTITION_KEY \\ \n --p1 $(Build.BuildId) \\\n --image-tag $tag_name \\\n --commit-id $commitId \\\n --service $service \\\n --repository $repourl\n```\n\n```\nspk deployment create -n $AZURE_STORAGE_ACCOUNT_NAME \\\n -k $AZURE_ACCOUNT_KEY \\\n -t $AZURE_TABLE_NAME \\\n -p $AZURE_TABLE_PARTITION_KEY \\ \n --p2 $(Build.BuildId) \\\n --hld-commit-id $latest_commit \\\n --env $(Build.SourceBranchName) \\\n --image-tag $tag_name \\\n --pr $pr_id \\\n --repository $repourl\n```\n\n```\nspk deployment create -n $AZURE_STORAGE_ACCOUNT_NAME \\\n -k $AZURE_ACCOUNT_KEY \\\n -t $AZURE_TABLE_NAME \\\n -p $AZURE_TABLE_PARTITION_KEY \\ \n --p3 $(Build.BuildId) \\ \n --hld-commit-id $commitId \\ \n --pr $pr_id \\\n --repository $repourl\n```\n" }, "deployment dashboard": { "command": "dashboard", @@ -141,8 +141,8 @@ "defaultValue": "" }, { - "arg": "-e, --env ", - "description": "Filter by environment name", + "arg": "-r, --ring ", + "description": "Filter by ring name", "defaultValue": "" }, { diff --git a/src/commands/deployment/get.decorator.json b/src/commands/deployment/get.decorator.json index fa5cc2e7..2a408d0a 100644 --- a/src/commands/deployment/get.decorator.json +++ b/src/commands/deployment/get.decorator.json @@ -24,8 +24,8 @@ "defaultValue": "" }, { - "arg": "-e, --env ", - "description": "Filter by environment name", + "arg": "-r, --ring ", + "description": "Filter by ring name", "defaultValue": "" }, { diff --git a/src/commands/deployment/get.test.ts b/src/commands/deployment/get.test.ts index 3f1c9653..3cc7e089 100644 --- a/src/commands/deployment/get.test.ts +++ b/src/commands/deployment/get.test.ts @@ -33,7 +33,7 @@ const MOCKED_INPUT_VALUES: CommandOptions = { buildId: "", commitId: "", deploymentId: "", - env: "", + ring: "", imageTag: "", output: "", service: "", @@ -45,7 +45,7 @@ const MOCKED_VALUES: ValidatedOptions = { buildId: "", commitId: "", deploymentId: "", - env: "", + ring: "", imageTag: "", nTop: 0, output: "", @@ -292,7 +292,7 @@ describe("Introspect deployments", () => { const dep = deployment as IDeployment; // Make sure the basic fields are defined - expect(dep.deploymentId).not.toBe(""); + // expect(dep.deploymentId).not.toBe(""); expect(dep.service).not.toBe(""); expect(duration(dep)).not.toBe(""); expect(status(dep)).not.toBe(""); @@ -321,7 +321,6 @@ describe("Print deployments", () => { const deployment = [ "2019-08-30T21:05:19.047Z", "hello-bedrock", - "7468ca0a24e1", "c626394", 6046, "hello-bedrock-master-6046", @@ -338,13 +337,13 @@ describe("Print deployments", () => { expect(table).toBeDefined(); if (table) { - const matchItems = table.filter((field) => field[2] === deployment[2]); + const matchItems = table.filter((field) => field[0] === deployment[0]); expect(matchItems).toHaveLength(1); // one matching row (matchItems[0] as IDeployment[]).forEach((field, i) => { expect(field).toEqual(deployment[i]); }); - expect(matchItems[0]).toHaveLength(14); + expect(matchItems[0]).toHaveLength(13); table = printDeployments( mockedDeps, @@ -395,7 +394,7 @@ describe("Output formats", () => { expect(table).toBeDefined(); if (table) { - table.forEach((field) => expect(field).toHaveLength(20)); + table.forEach((field) => expect(field).toHaveLength(19)); } }); }); diff --git a/src/commands/deployment/get.ts b/src/commands/deployment/get.ts index c5650ed0..f00627f3 100644 --- a/src/commands/deployment/get.ts +++ b/src/commands/deployment/get.ts @@ -61,7 +61,7 @@ export interface InitObject { export interface CommandOptions { watch: boolean; output: string; - env: string; + ring: string; imageTag: string; buildId: string; commitId: string; @@ -117,7 +117,7 @@ export const validateValues = (opts: CommandOptions): ValidatedOptions => { buildId: opts.buildId, commitId: opts.commitId, deploymentId: opts.deploymentId, - env: opts.env, + ring: opts.ring, imageTag: opts.imageTag, nTop: top, output: opts.output, @@ -307,13 +307,12 @@ export const printDeployments = ( let header = [ "Start Time", "Service", - "Deployment", "Commit", "Src to ACR", "Image Tag", "Result", "ACR to HLD", - "Env", + "Ring", "Hld Commit", "Result", ]; @@ -373,7 +372,6 @@ export const printDeployments = ( : "-" ); row.push(deployment.service !== "" ? deployment.service : "-"); - row.push(deployment.deploymentId); row.push(deployment.commitId !== "" ? deployment.commitId : "-"); row.push( deployment.srcToDockerBuild ? deployment.srcToDockerBuild.id : "-" @@ -515,7 +513,7 @@ export const getDeployments = async ( initObj.srcPipeline, initObj.hldPipeline, initObj.clusterPipeline, - values.env, + values.ring, values.imageTag, values.buildId, values.commitId,