-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
27 lines (24 loc) · 1.05 KB
/
buildspec.yml
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
version: 0.1
environment_variables:
plaintext:
AWS_DEFAULT_REGION: "eu-west-2"
IMAGE_TAG: "latest"
IMAGE_REPO_NAME: "gs-docker-codebuild"
#ACCOUNT_ID: $(echo $CODEBUILD_BUILD_ARN | awk -F":" '{print $5}') # this is not working so for now
#ACCOUNT_ID: "654386450934" # hard code this value here
ACCOUNT_ID: "244560807427"
phases:
pre_build:
commands:
- echo $AWS_DEFAULT_REGION
- echo Logging in to Amazon ECR...
- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION)
build:
commands:
- echo "Build started on `date`"
#- docker build -t gs-docker-codebuild:latest docker/alpine-python/.
- docker build -t gs-docker-codebuild:latest docker/alpine-gcc-python/.
- docker tag gs-docker-codebuild:latest $ACCOUNT_ID.dkr.ecr.eu-west-2.amazonaws.com/gs-docker-codebuild:latest
- echo Build completed on `date`
- echo Pushing the Docker image...
- docker push $ACCOUNT_ID.dkr.ecr.eu-west-2.amazonaws.com/gs-docker-codebuild:latest