-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
40 lines (40 loc) · 1.83 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
version: 0.2
phases:
install:
commands:
- echo "[Install phase]"
# Install all dependencies (including dependencies for running tests)
- npm install
pre_build:
commands:
- echo "[Pre-Build phase]"
- rm -rf ./airtable
# Discover and run unit tests in the '__tests__' directory
- npm run test
# Remove all unit tests to reduce the size of the package that will be ultimately uploaded to Lambda
- rm -rf ./tests
# Remove all dependencies not needed for the Lambda deployment package (the packages from devDependencies in package.json)
- npm prune --production
# Reserve dependencies for lambda layer
- mkdir -p lib/nodejs/
- cp -R node_modules lib/nodejs/
build:
commands:
- echo "[Build phase]"
- echo "Starting SAM packaging `date` in `pwd`"
# Use AWS SAM to package the application by using AWS CloudFormation
- aws cloudformation package --template template.yml --s3-bucket $S3_BUCKET --output-template template-export.yml
# - echo "${ENV_TYPE}"
# - |
# if [ "$ENV_TYPE" = "prod" ] ; then
# aws cloudformation package --template template.master.yml --s3-bucket $S3_BUCKET --output-template template-export.yml
# fi
# - |
# if [ "$ENV_TYPE" = "test" ]; then
# aws cloudformation package --template template.yml --s3-bucket $S3_BUCKET --output-template template-export.yml
# fi
# --parameter-overrides EnvType=${ENV_TYPE} AirtableBase=${AIRTABLE_BASE} AirtableApiKey=${AIRTABLE_API_KEY} TwilioAccountSid=${TWILIO_ACCOUNT_SID} TwilioAuthToken=${TWILIO_AUTH_TOKEN} TwilioPhone=${TWILIO_PHONE} CrowwknowledgeHost=${CROSSKNOWLEDGE_HOST} CrossknowledgeApiKey=${CROSSKNOWLEDGE_API_KEY} ErrorTopicArn=${ERROR_TOPIC_ARN}
artifacts:
type: zip
files:
- template-export.yml