Last active
July 19, 2018 02:32
-
-
Save rcdexta/e02bd83d251e7ddc0382cfa2d3454abc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
version: 0.2 | |
phases: | |
pre_build: | |
commands: | |
- IMAGE_TAG=$(echo $CODEBUILD_RESOLVED_SOURCE_VERSION | cut -c 1-7) | |
- npm ci | |
- $(aws ecr get-login --region $AWS_DEFAULT_REGION) | |
build: | |
commands: | |
- echo Running tests | |
- npm run test | |
- echo Packaging application | |
- docker build -t $REPOSITORY_URI:latest . | |
- docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG | |
post_build: | |
commands: | |
- echo Pushing the Docker images... | |
- docker push $REPOSITORY_URI:$IMAGE_TAG | |
- echo Writing image definitions file... | |
- printf '[{"name":"expresso-staging","imageUri":"%s"}]' $REPOSITORY_URI:$IMAGE_TAG > imagedefinitions.json | |
cache: | |
paths: | |
- ~/.npm | |
- /var/lib/docker/**/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment