forked from i-dot-ai/scout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
41 lines (36 loc) · 1.42 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
38
39
40
41
version: 0.2
phases:
install:
commands:
- echo "Installing dependencies"
- pip install --upgrade awscli
pre_build:
commands:
- echo "Logging in to Amazon ECR"
- aws ecr get-login-password --region $AWS_REGION | docker login --username AWS --password-stdin $AWS_ACCOUNT_ID.dkr.ecr.$AWS_REGION.amazonaws.com
build:
commands:
- echo "SKIP Building a Docker image for backend"
# - docker build -t $ECR_REPOSITORY_BACKEND_URL:latest -f backend/Dockerfile .
- echo "Building a Docker image for frontend"
- docker build -t $ECR_REPOSITORY_FRONTEND_URL:latest -f frontend/Dockerfile frontend
post_build:
commands:
- echo "Build completed on `date`"
- echo "SKIP Pushing the backend Docker image..."
# - docker push $ECR_REPOSITORY_BACKEND_URL:latest
- echo "Pushing the frontend Docker image..."
- docker push $ECR_REPOSITORY_FRONTEND_URL:latest
- echo "Writing image definitions file for ECS deployment..."
# - printf '[{"name":"backend","imageUri":"%s"}]' $ECR_REPOSITORY_BACKEND_URL:latest > imagedefinitions.json
- printf '[{"name":"frontend","imageUri":"%s"}]' $ECR_REPOSITORY_FRONTEND_URL:latest >> imagedefinitions.json
- echo Contents of imagedefinitions.json:
- cat imagedefinitions.json
artifacts:
files:
- imagedefinitions.json
name: image_definitions
cache:
paths:
- /root/.cache/pip
- /root/.npm