-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
c3b04aa
commit 2c20013
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |