-
Notifications
You must be signed in to change notification settings - Fork 49
/
Copy pathbuildspec_dockerize_ui.yml
34 lines (34 loc) · 1.27 KB
/
buildspec_dockerize_ui.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
version: 0.2
phases:
install:
runtime-versions:
nodejs: 16
python: '3.10'
commands:
- pwd
- ls
- echo Printing variables $ecr_repo $account_id $region $user_pool_id $client_id
pre_build:
commands:
- echo Logging in to Amazon ECR...
- aws ecr get-login-password --region $region | docker login --username AWS --password-stdin $account_id.dkr.ecr.$region.amazonaws.com
build:
commands:
- echo Install JQ
- sudo apt-get update
- sudo apt-get install jq
- git clone https://github.com/aws-samples/serverless-rag-demo.git
- ls
- cd serverless-rag-demo
- jq -n --arg region "$region" --arg user_pool_id "$user_pool_id" --arg client_id "$client_id" --arg rest_endpoint_url $rest_endpoint_url --arg streaming_url "$streaming_url" '{ region:$region, userPoolId:$user_pool_id, clientId:$client_id, apiUrl:$rest_endpoint_url, websocketUrl:$streaming_url }' > artifacts/chat-ui/src/config.json
- echo Build started on `date`
- echo Building the Docker image ...
- cd artifacts/chat-ui/
- ls
- docker build -t $ecr_repo .
- docker images
post_build:
commands:
- echo Build completed on `date`
- echo Pushing the Docker image...
- docker push $ecr_repo