File tree Expand file tree Collapse file tree 4 files changed +69
-1
lines changed Expand file tree Collapse file tree 4 files changed +69
-1
lines changed Original file line number Diff line number Diff line change
1
+ name : Test Build Script
2
+
3
+ on :
4
+ schedule :
5
+ - cron : " 0 0 * * 0"
6
+ push :
7
+ branches :
8
+ - main
9
+ pull_request :
10
+ branches :
11
+ - ' *'
12
+
13
+ jobs :
14
+ test-local-build-and-e2e :
15
+ runs-on : ubuntu-latest
16
+ name : Test deploy.sh in standard environment
17
+
18
+ steps :
19
+ - name : Checkout code
20
+ uses : actions/checkout@v3
21
+
22
+ - name : Set up Python
23
+ uses : actions/setup-python@v4
24
+ with :
25
+ python-version : ' 3.12'
26
+
27
+ - name : Install AWS SAM CLI
28
+ run : pip install aws-sam-cli
29
+
30
+ - name : Test deploy.sh script
31
+ run : ./deploy.sh
32
+
33
+ - name : Test local uvicorn/FastAPI server
34
+ run : |
35
+ mv .aws-sam/build/BedrockAccessGatewayLayer/python/* ./app
36
+ (cd app && ./run.sh &)
37
+ timeout 30 bash -c 'while ! nc -z localhost 8000; do sleep 1; done'
38
+ curl localhost:8000/health | jq
39
+ curl localhost:8000/api/v1/models -H 'Authorization: Bearer bedrock' | jq
40
+
41
+ test-cloudshell-build :
42
+ runs-on : ubuntu-latest
43
+ name : Test deploy.sh in CloudShell environment
44
+ container :
45
+ image : public.ecr.aws/amazonlinux/amazonlinux:2023
46
+ env :
47
+ AWS_EXECUTION_ENV : CloudShell
48
+
49
+ steps :
50
+ - name : Install dependencies
51
+ run : |
52
+ yum install -y sudo python3-pip tar git
53
+ pip3 install aws-sam-cli
54
+
55
+ - name : Checkout code
56
+ uses : actions/checkout@v3
57
+
58
+ - name : Test deploy.sh script
59
+ run : ./deploy.sh
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- PYTHON_VERSION=3.12
3
+ export PYTHON_VERSION=3.12
4
+ export SAM_CLI_TELEMETRY=0
4
5
5
6
# Parse command line arguments
6
7
while [[ $# -gt 0 ]]; do
27
28
./prepare_source.sh $NO_EMBEDDINGS
28
29
29
30
sam build $USE_CONTAINER
31
+
32
+ if [[ ! -z " $CI " ]]; then
33
+ exit
34
+ fi
35
+
30
36
sam deploy --guided
Original file line number Diff line number Diff line change 63
63
64
64
cp -r $REPO_DIR /src/api app/api
65
65
66
+ # To surpress warnings
67
+ echo " " > app/requirements.txt
68
+
66
69
# Remove "Manum" from requirements.txt, as LWA is used instead.
67
70
grep -v " mangum" $REPO_DIR /src/requirements.txt > layer/requirements.txt
68
71
grep -v " Mangum" $REPO_DIR /src/api/app.py > app/api/app.py
You can’t perform that action at this time.
0 commit comments