-
Notifications
You must be signed in to change notification settings - Fork 0
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
3e48fd5
commit bc5b1d2
Showing
1 changed file
with
34 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,34 @@ | ||
version: 0.2 | ||
|
||
phases: | ||
install: | ||
commands: | ||
- nohup /usr/local/bin/dockerd --host=unix:///var/run/docker.sock --host=tcp://127.0.0.1:2375 --storage-driver=overlay2 & | ||
- timeout 15 sh -c "until docker info; do echo .; sleep 1; done" | ||
pre_build: | ||
commands: | ||
- echo log in to Amazon ECR... | ||
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username $ECR_LOGIN_USER --password-stdin $ECR_LOGIN_PASS | ||
- REPOSITORY_URI=$REPO_URL | ||
- IMAGE_TAG=${COMMIT_HASH:=latest} | ||
build: | ||
commands: | ||
- echo Build started on `date` | ||
- echo Building the Docker image. | ||
- echo log in to Amazon ECR... | ||
- aws --version | ||
- docker build -t $REPO_NAME . | ||
- docker tag $REPO_NAME:latest $REPOSITORY_URI:latest | ||
post_build: | ||
commands: | ||
- echo Build completed on `date` | ||
- docker push $REPOSITORY_URI:latest | ||
- printf '[{"name":"main-service","imageUri":"%s"}]' $REPOSITORY_URI:latest > imagedefinitions.json | ||
artifacts: | ||
files: imagedefinitions.json | ||
|
||
cache: | ||
paths: | ||
- '/root/.docker/cli-plugins' | ||
- '/root/.npm/**/*' | ||
- 'dist/**/*' |