Skip to content

Commit 0d564cc

Browse files
author
mike dupont
committed
adding aws build spec
1 parent 172b383 commit 0d564cc

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

buildspec.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
version: 0.2
2+
3+
phases:
4+
pre_build:
5+
commands:
6+
- echo Logging in to Amazon ECR...
7+
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com
8+
build:
9+
commands:
10+
- echo Build started on `date`
11+
- echo Building the Docker image...
12+
- docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG .
13+
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG
14+
post_build:
15+
commands:
16+
- echo Build completed on `date`
17+
- echo Pushing the Docker image...
18+
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG

0 commit comments

Comments
 (0)