Amazon Q 开发者版中的示例开发文件
以下示例显示符合开发文件规范
有关开发文件及其在 Amazon Q 中的使用方式的更多信息,请参阅测试由 Amazon Q“/dev”命令生成的代码建议。
Python 示例
以下示例显示一个可以与 Python 项目结合使用的开发文件。
schemaVersion: 2.0.0 components: - name: dev container: image: public.ecr.aws/aws-mde/universal-image:latest commands: - id: install exec: component: dev commandLine: "pip3.11 install -r requirements.txt" - id: test exec: component: dev commandLine: "python3.11 manage.py makemigrations && python3.11 manage.py test"
Node 示例
以下示例显示一个可以与 Node.js 项目结合使用的开发文件。
schemaVersion: 2.0.0 components: - name: dev container: image: public.ecr.aws/aws-mde/universal-image:latest commands: - id: install exec: component: dev commandLine: "npm install" - id: build exec: component: dev commandLine: "npm run build" - id: test exec: component: dev commandLine: "npm run test"
示例的说明
下表描述前面的开发文件示例中的每一行或每个代码块。
| 行或代码块 | 描述 |
|---|---|
|
指定开发文件架构版本。Amazon Q 仅支持架构版本 2.0.0 |
|
要部署到开发环境中的组件列表。 |
|
指示使用公有 Amazon Elastic Container Registry(Amazon ECR)中提供的最新通用映像 Docker 映像作为开发环境。您可以更改此映像的版本,也可以用自己的映像替换该映像。有关更多信息,请参阅 通用映像内容。 |
|
要执行的命令列表。 |
|
|