forked from vinayselvaraj/aws-lambda-libpostal-python-demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
20 lines (19 loc) · 893 Bytes
/
buildspec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
version: 0.2
phases:
pre_build:
commands:
- 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
- date +'%Y%m%d%H%M%S' > image_tag
- echo "{ \"image_name\" ":" \"`echo $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME`\", \"image_tag\" ":" \"`cat image_tag`\" }" > output.json
build:
commands:
- docker build -f Dockerfile -t $IMAGE_REPO_NAME:`cat image_tag` .
- docker tag $IMAGE_REPO_NAME:`cat image_tag` $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:`cat image_tag`
post_build:
commands:
- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:`cat image_tag`
artifacts:
files:
- output.json
- template.yaml
discard-paths: yes