Amazon Q Developer의 devfile 예제 - Amazon Q Developer

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

Amazon Q Developer의 devfile 예제

다음 예제는 devfile 사양을 준수하고 Amazon Q와 함께 사용하기에 적합한 devfile을 보여줍니다.이 예제는이 페이지의 끝에 설명되어 있습니다.

devfile 및 Amazon Q에서 devfile이 사용되는 방법에 대한 자세한 내용은 섹션을 참조하세요Amazon Q '/dev' 명령으로 생성된 코드 제안 테스트.

Python 예제

다음 예제는 Python 프로젝트와 함께 사용할 수 있는 devfile을 보여줍니다.

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.js 프로젝트와 함께 사용할 수 있는 devfile을 보여줍니다.

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"

예제 설명

다음 표에서는 이전 devfile 예제의 각 줄 또는 코드 블록을 설명합니다.

줄 또는 코드 블록 설명
schemaVersion: 2.0.0

devfile 스키마 버전을 지정합니다. Amazon Q는 스키마 버전 2.0.0만 지원합니다.

components:

개발 환경에 배포할 구성 요소의 목록입니다.

- name: dev container: image: public.ecr.aws/aws-mde/universal-image:latest

퍼블릭 Amazon Elastic Container Registry(Amazon ECR)에서 개발 환경으로 사용할 수 있는 최신 범용 이미지 도커 이미지를 사용함을 나타냅니다. 이 이미지의 버전을 변경하거나 이미지를 자신의 이미지로 바꿀 수 있습니다. 자세한 내용은 범용 이미지 콘텐츠 단원을 참조하십시오.

commands:

수행할 명령 목록입니다.

- id: install|build|test exec: component: dev commandLine: "cli-instructions"

install, build또는 test 명령. Amazon Q는 개발 환경의 범용 이미지(또는에 지정된 이미지)에서 cli-instructions 지침을 실행합니다image:. cli-instructions는 프로젝트의 컨텍스트에 따라 달라집니다. 필요에 맞게 이러한 명령을 변경할 수 있습니다.