forked from trinitronx/docker-python-simplehttpserver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildspec.yml
More file actions
30 lines (25 loc) · 915 Bytes
/
buildspec.yml
File metadata and controls
30 lines (25 loc) · 915 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
version: 0.2
env:
variables:
IMAGE_REPO_NAME: docker-python-simplehttpserver
phases:
install:
commands:
# Install CDK & jq, upgrade npm
- apt-get update
- apt-get install -y jq
pre_build:
commands:
# Set up environment variables like image tag and repo
- export IMAGE_TAG=build-`echo $CODEBUILD_BUILD_ID | awk -F":" '{print $2}'`
- AWS_ACCOUNT_ID=`echo $CODEBUILD_BUILD_ARN | awk -F":" '{print $5}'`
- ECR_REPO=$AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME
- $(aws ecr get-login --no-include-email)
build:
commands:
# Build Docker image
- docker build -t $IMAGE_REPO_NAME:$IMAGE_TAG .
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $ECR_REPO:$IMAGE_TAG
- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $ECR_REPO:latest
# - docker push $ECR_REPO:$IMAGE_TAG
- docker push $ECR_REPO:latest