-
Notifications
You must be signed in to change notification settings - Fork 27
/
buildspec.yml
37 lines (32 loc) · 1.19 KB
/
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
34
35
36
37
version: 0.2
env:
secrets-manager:
DOCKER_USER: "BuildEnv:DOCKER_USER"
DOCKER_PASSWORD: "BuildEnv:DOCKER_PASSWORD"
phases:
pre_build:
commands:
- echo Logging into Amazon ECR
- aws ecr get-login-password --region $AWS_DEFAULT_REGION | docker login --username AWS --password-stdin 349501831018.dkr.ecr.us-west-2.amazonaws.com
- echo changing node version
- n 8.17.0
build:
commands:
- echo Build started on `date`
- echo Running build
- npm --version
- npm install
- make build
- echo Logging into docker
- docker login -u $DOCKER_USER -p $DOCKER_PASSWORD
- echo Building the docker image...
- docker build --rm=false -t $IMAGE_NAME .
- docker tag $IMAGE_NAME:latest 349501831018.dkr.ecr.us-west-2.amazonaws.com/$IMAGE_NAME:latest
post_build:
commands :
- echo Build completed on `date`
- echo Pushing the Docker image...
- docker push 349501831018.dkr.ecr.us-west-2.amazonaws.com/$IMAGE_NAME:latest
- echo updating ecs service....
- aws ecs update-service --cluster $CLUSTER_NAME --service $SERVICE_NAME --force-new-deployment
- echo Done updating ecs