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

Commit 8a6a84d

Browse files
authored
generate doc for command (#454)
* generate doc for command * added pre-commit hook
1 parent 7fd1606 commit 8a6a84d

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

docs/commands/data.json

+4-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"defaultValue": false
1515
}
1616
],
17-
"markdown": "This command creates a configuration file, `config.yaml` in a folder `.spk`\nunder your home directory. There are two options for creating this file\n\n1. an interactive mode where you have to answer a few questions; and\n2. you provide a `yaml` file and this `yaml` will be copied to the target\n location.\n\n## Interactive mode\n\nThe command line tool attempts to read `config.yaml` in a folder `.spk` under\nyour home directory. Configuration values shall be read from it if it exists.\nAnd these values shall be default values for the questions. Otherwise, there\nshall be no default values. These are the questions\n\n1. Organization Name of Azure dev-op account\n2. Project Name of Azure dev-op account\n3. Personal Access Token (guides)\n\nThis tool shall verify these values by making an API call to Azure dev-op. They\nshall be written to `config.yaml` regardless the verification is successful or\nnot.\n\n> Note: In the event that you do not have internet connection, this verification\n> shall not be possible\n\n## Example\n\n```\nspk init --interactive\n```\n\nor\n\n```\nspk init --file myConfig.yaml\n```\n"
17+
"markdown": "This command creates a configuration file, `config.yaml` in a folder `.spk`\nunder your home directory. There are two options for creating this file\n\n1. an interactive mode where you have to answer a few questions; and\n2. you provide a `yaml` file and this `yaml` will be copied to the target\n location.\n\n## Interactive mode\n\nThe command line tool attempts to read `config.yaml` in a folder `.spk` under\nyour home directory. Configuration values shall be read from it if it exists.\nAnd these values shall be default values for the questions. Otherwise, there\nshall be no default values. These are the questions\n\n1. Organization Name of Azure dev-op account\n2. Project Name of Azure dev-op account\n3. Personal Access Token (guides)\n4. Would like to have introspection configuration setup? If yes\n 1. Storage Account Name\n 1. Storage Table Name\n 1. Storage Partition Key\n 1. Storage Access Key\n 1. Key Vault Name (optional)\n\nThis tool shall verify these values by making an API call to Azure dev-op. They\nshall be written to `config.yaml` regardless the verification is successful or\nnot.\n\n> Note: In the event that you do not have internet connection, this verification\n> shall not be possible\n\n## Example\n\n```\nspk init --interactive\n```\n\nor\n\n```\nspk init --file myConfig.yaml\n```\n"
1818
},
1919
"setup": {
2020
"command": "setup",
@@ -26,7 +26,7 @@
2626
"description": "Path to the file that contains answers to the questions."
2727
}
2828
],
29-
"markdown": "## Description\n\nThis command assists in creating resources in Azure DevOps so that you can get\nstarted with using Bedrock. It creates\n\n1. An Azure DevOps project.\n\nBy Default, it runs in an interactive mode where you are prompted for answers\nfor a few questions\n\n1. Azure DevOps Organization Name\n2. Azure DevOps Project Name, the project to be created.\n3. Azure DevOps Personal Access Token. The token needs to have these permissions\n 1. Read and write projects.\n 2. Read and write codes.\n4. To create a sample application Repo\n 1. If Yes, a Azure Service Principal is needed. You have 2 options\n 1. have the command line tool to create it. Azure command line tool shall\n be used\n 2. provide the Service Principal Id, Password and Tenant Id.\n 2. Subscription Id is automatically retrieved with the Service Principal\n credential. In case, there are two or more subscriptions, you will be\n prompt to select one of them.\n 3. Create a resource group, `quick-start-rg` if it does not exist.\n 4. Create a Azure Container Registry, `quickStartACR` in resource group,\n `quick-start-rg` if it does not exist.\n\nIt can also run in a non interactive mode by providing a file that contains\nanswers to the above questions.\n\n```\nspk setup --file <file-name>\n```\n\nContent of this file is as follow\n\n```\nazdo_org_name=<Azure DevOps Organization Name>\nazdo_project_name=<Azure DevOps Project Name>\nazdo_pat=<Azure DevOps Personal Access Token>\naz_create_app=<true to create sample service app>\naz_create_sp=<true to have command line to create service principal>\naz_sp_id=<sevice principal Id need if az_create_app=true and az_create_sp=false>\naz_sp_password=<sevice principal password need if az_create_app=true and az_create_sp=false>\naz_sp_tenant=<sevice principal tenant Id need if az_create_app=true and az_create_sp=false>\n```\n\n`azdo_project_name` is optional and default value is `BedrockRocks`.\n\nThe followings shall be created\n\n1. A working directory, `quick-start-env`\n2. Project shall not be created if it already exists.\n3. A Git Repo, `quick-start-hld`, it shall be deleted and recreated if it\n already exists.\n 1. And initial commit shall be made to this repo\n4. A Git Repo, `quick-start-manifest`, it shall be deleted and recreated if it\n already exists.\n 1. And initial commit shall be made to this repo\n5. A High Level Definition (HLD) to Manifest pipeline.\n6. A Service Principal (if requested)\n\n## Setup log\n\nA `setup.log` file is created after running this command. This file contains\ninformation about what are created and the execution status (completed or\nincomplete). This file will not be created if input validation failed.\n\n## Note\n\nTo remove the service principal that it is created by the tool, you can do the\nfollowings:\n\n1. Get the identifier from `setup.log` (look for `az_sp_id`)\n2. run on terminal `az ad sp delete --id <the sp id>`\n"
29+
"markdown": "## Description\n\nThis command assists in creating resources in Azure DevOps so that you can get\nstarted with using Bedrock. It creates\n\n1. An Azure DevOps project.\n\nBy Default, it runs in an interactive mode where you are prompted for answers\nfor a few questions\n\n1. Azure DevOps Organization Name\n2. Azure DevOps Project Name, the project to be created.\n3. Azure DevOps Personal Access Token. The token needs to have these permissions\n 1. Read and write projects.\n 2. Read and write codes.\n4. To create a sample application Repo\n 1. If Yes, a Azure Service Principal is needed. You have 2 options\n 1. have the command line tool to create it. Azure command line tool shall\n be used. You will be prompted to select a subscription identifier.\n 2. Provide the Service Principal Id, Password, and Tenant Id. From this\n information, the tool will retrieve the subscription identifier.\n\nIt can also run in a non interactive mode by providing a file that contains\nanswers to the above questions.\n\n```\nspk setup --file <file-name>\n```\n\nContent of this file is as follow\n\n```\nazdo_org_name=<Azure DevOps Organization Name>\nazdo_project_name=<Azure DevOps Project Name>\nazdo_pat=<Azure DevOps Personal Access Token>\naz_create_app=<true to create sample service app>\naz_create_sp=<true to have command line to create service principal>\naz_sp_id=<sevice principal Id need if az_create_app=true and az_create_sp=false>\naz_sp_password=<sevice principal password need if az_create_app=true and az_create_sp=false>\naz_sp_tenant=<sevice principal tenant Id need if az_create_app=true and az_create_sp=false>\naz_subscription_id=<subscription id>\naz_acr_name=<name of azure container registry>\n```\n\n`azdo_project_name` is optional and default value is `BedrockRocks`.\n\nThe followings shall be created\n\n1. A working directory, `quick-start-env`\n2. Project shall not be created if it already exists.\n3. A Git Repo, `quick-start-hld`, it shall be deleted and recreated if it\n already exists.\n 1. And initial commit shall be made to this repo\n4. A Git Repo, `quick-start-manifest`, it shall be deleted and recreated if it\n already exists.\n 1. And initial commit shall be made to this repo\n5. A High Level Definition (HLD) to Manifest pipeline.\n6. If user chose to create sample app repo\n 1. A Service Principal (if requested)\n 2. A resource group, `quick-start-rg` if it does not exist.\n 3. A Azure Container Registry, `quickStartACR` in resource group,\n `quick-start-rg` if it does not exist.\n 4. A Git Repo, `quick-start-helm`, it shall be deleted and recreated if is\n already exists.\n 5. A Git Repo, `quick-start-app`, it shall be deleted and recreated if is\n already exists.\n 6. A Lifecycle pipeline.\n 7. A Build pipeline.\n\n## Setup log\n\nA `setup.log` file is created after running this command. This file contains\ninformation about what are created and the execution status (completed or\nincomplete). This file will not be created if input validation failed.\n\n## Note\n\nTo remove the service principal that it is created by the tool, you can do the\nfollowings:\n\n1. Get the identifier from `setup.log` (look for `az_sp_id`)\n2. run on terminal `az ad sp delete --id <the sp id>`\n"
3030
},
3131
"deployment create": {
3232
"command": "create",
@@ -155,7 +155,7 @@
155155
"defaultValue": ""
156156
},
157157
{
158-
"arg": "-O, --output <output-format>",
158+
"arg": "-o, --output <output-format>",
159159
"description": "Output the information one of the following: normal, wide, JSON",
160160
"defaultValue": "normal"
161161
},
@@ -673,4 +673,4 @@
673673
}
674674
]
675675
}
676-
}
676+
}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
},
6161
"husky": {
6262
"hooks": {
63-
"pre-commit": "lint-staged"
63+
"pre-commit": "lint-staged && ts-node tools/generateDoc.ts && git add docs/commands/data.json"
6464
}
6565
},
6666
"lint-staged": {

0 commit comments

Comments
 (0)