n-daisuke-blog-deployment-s.../ci/buildspec.yml
Daisuke b9d4623d63 chore: add CI/CD tooling and project configuration
- Add commit-message-generator skill for standardized commit messages
 - Add buildspec.yml for CodeBuild Docker image build process
 - Add build-artifact.sh script for creating deployment packages
 - Add .gitignore to exclude zip files from version control
2026-01-04 12:47:40 +09:00

20 lines
807 B
YAML

version: 0.2
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $ECR_REPOSITORY_URI
- IMAGE_TAG=$(date +%s)
- echo "Image tag will be ${IMAGE_TAG}"
build:
commands:
- echo Build started on `date`
- echo Building Docker image for ARM64/Lambda...
- docker build --platform linux/arm64 -f docker/Dockerfile -t $ECR_REPOSITORY_URI:$IMAGE_TAG -t $ECR_REPOSITORY_URI:latest .
post_build:
commands:
- echo Build completed on `date`
- echo Pushing Docker images...
- docker push $ECR_REPOSITORY_URI:$IMAGE_TAG
- docker push $ECR_REPOSITORY_URI:latest
- echo "Image pushed with tags ${IMAGE_TAG} and latest"