-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildspec.yml
More file actions
23 lines (21 loc) · 791 Bytes
/
Copy pathbuildspec.yml
File metadata and controls
23 lines (21 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
version: 0.2
phases:
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin 390403865161.dkr.ecr.us-east-1.amazonaws.com
- REPOSITORY_URI=390403865161.dkr.ecr.us-east-1.amazonaws.com/simpledeployapp
- IMAGE_TAG=latest
build:
commands:
- echo Building Docker image...
- docker build -t $REPOSITORY_URI:$IMAGE_TAG .
post_build:
commands:
- echo Pushing Docker image to ECR...
- docker push $REPOSITORY_URI:$IMAGE_TAG
- echo Writing imagedefinitions.json file...
- printf '[{"name":"simpledeployapp","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
artifacts:
files:
- imagedefinitions.json