Example devfiles in Amazon Q Developer
The following examples show devfiles that comply with the devfile specification
For more information about devfiles and how they're used in Amazon Q, see Testing code suggestions generated by the Amazon Q '/dev' command.
Python example
The following example shows a devfile that you could use with a Python project.
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 example
The following example shows a devfile that you could use with a Node.js project.
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"
Explanation of examples
The following table describes each line or code block in the preceding devfile examples.
Line or code block | Description |
---|---|
|
Specifies the devfile schema version. Amazon Q only supports schema version
2.0.0 |
|
A list of components to deploy onto the dev environment. |
|
Indicates to use the latest universal image Docker image available in the public Amazon Elastic Container Registry (Amazon ECR) as the dev environment. You can change the version of this image, or you can replace the image with one of your own. For more information, see Universal image contents. |
|
A list of commands to perform. |
|
An |