forked from i-dot-ai/scout
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
41 lines (35 loc) · 1.32 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 eu-west-2 | docker login --username AWS --password-stdin $ECR_DOCKER_REGISTRY
build:
commands:
- echo "Building a Docker image for backend"
- docker build -t $ECR_REPOSITORY_BACKEND_URL -f backend/Dockerfile .
- echo "Building a Docker image for frontend"
- docker build -t $ECR_REPOSITORY_FRONTEND_URL -f frontend/Dockerfile .
post_build:
commands:
- echo "Build completed on `date`"
- echo "Pushing the backend Docker images..."
- docker push $ECR_REPOSITORY_BACKEND_URL
- echo "Pushing the frontend Docker images..."
- docker push $ECR_REPOSITORY_FRONTEND_URL
- echo "Writing image definitions files..."
- printf '[{"name":"scout-backend","imageUri":"%s:latest"}]' $ECR_REPOSITORY_BACKEND_URL > backend_imagedefinitions.json
- printf '[{"name":"scout-fronted","imageUri":"%s:latest"}]' $ECR_REPOSITORY_FRONTEND_URL > frontend_imagedefinitions.json
artifacts:
files:
- backend_imagedefinitions.json
- frontend_imagedefinitions.json
name: image_definitions
cache:
paths:
- /root/.cache/pip
- /root/.npm