forked from voyagerwoo/petclinic-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildspec.yml
33 lines (28 loc) · 867 Bytes
/
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
28
29
30
31
32
33
version: 0.2
# build image : aws/codebuild/java:openjdk-8
env:
variables:
IMAGE_REPO_NAME: "petclinic-rest"
phases:
pre_build:
commands:
- echo "Logging in to Amazon ECR..."
- DOCKER_LOGIN=`aws ecr get-login --no-include-email`
- ${DOCKER_LOGIN}
build:
commands:
- echo "Build started on `date`"
- echo "Building the Docker image..."
- mvn clean package docker:build -Dmaven.test.skip=true
post_build:
commands:
- echo "Build completed on `date`"
- echo "Pushing the Docker image..."
- docker push $DOCKER_REGISTRY_HOST/$IMAGE_REPO_NAME:latest
# ECS container name
- printf '[{"name":"petclinic-rest","imageUri":"%s"}]' $DOCKER_REGISTRY_HOST/$IMAGE_REPO_NAME:latest > imagedefinitions.json
artifacts:
files: imagedefinitions.json
cache:
paths:
- '/root/.m2/**/*'