Skip to content

Commit

Permalink
Configuring AWS deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
glenrobson committed Jun 5, 2019
1 parent c3b04aa commit 2c20013
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions buildspec.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: 0.2

phases:
install:
runtime-versions:
docker: 18
commands:
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay&
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done"
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws --version
- $(aws ecr get-login --region $AWS_DEFAULT_REGION --no-include-email)
- IMAGE_NAME="SAS"
- REPOSITORY_URI=082101253860.dkr.ecr.eu-west-2.amazonaws.com/simple_annotation_server
- IMAGE_TAG=prod_$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7)
build:
commands:
- echo Build started on `date`
- echo Building the Docker image...
- echo Image_tag $IMAGE_TAG
- docker build -t $REPOSITORY_URI:latest .
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker images...
- docker push $REPOSITORY_URI:$IMAGE_TAG
- echo Writing image definitions file...
- printf '[{"name":"eventsContainer","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json
artifacts:
files: imagedefinitions.json

0 comments on commit 2c20013

Please sign in to comment.