-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuildspec_deploy_api.yaml
46 lines (44 loc) · 1.43 KB
/
buildspec_deploy_api.yaml
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
42
43
44
45
46
version: 0.2
env:
variables:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
ARTIFACTS_BUCKET: galudy-visual-search-artifacts
S3_API_PREFIX: sagemaker-autopilot-api-gateway
API_STACK_NAME: sagemaker-autopilot-api-gateway
phases:
install:
runtime-versions:
python: 3.8
commands:
- pip install -r requirements.txt
pre_build:
commands:
- echo "Run AWS SAM Build on workflow stack and API stack"
- export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query "Account" --output text)
- echo "SAM package workflow template"
- |
sh -c """
cd api-gateway
sam build -b deploy/
sam package --template-file deploy/template.yaml \
--output-template-file packaged.template.yaml \
--s3-bucket ${ARTIFACTS_BUCKET} \
--s3-prefix ${S3_API_PREFIX}
"""
- echo "SAM package REST API template"
build:
commands:
- echo Build started on `date`
- |
sh -c """
cd api-gateway
sam deploy --stack-name ${API_STACK_NAME} \
--template-file packaged.template.yaml \
--parameter-overrides SageMakerEndpoint=${SAGEMAKER_ENDPOINT} SageMakerAutopilotTargetModel=${SAGEMAKER_AUTOPILOT_TARGET_MODEL} \
--capabilities CAPABILITY_IAM \
--no-fail-on-empty-changeset
"""
post_build:
commands:
- echo "Build Completed"