-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuildspec.yml
42 lines (32 loc) · 1.65 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
42
version: 0.2
phases:
install:
runtime-versions:
nodejs: latest # Latest for the build compute instance. Update deploy for settings and latest node version available.
commands:
# Install dependencies needed for application
- cd app
- npm ci
# Perform a fix to move us forward, then check to make sure there were no unresolved high fixes
- npm audit fix --force
- npm audit --audit-level=high
# Go back to root
- cd ..
# Upgrade to latest
- pip install --upgrade pip
- pip install --upgrade awscli
pre_build:
commands:
# Generate Key in SSM for cache-proxy
- chmod a+x tools/generate-put-keys.sh
- tools/generate-put-keys.sh $PARAM_STORE_PATH "256" $AWS_REGION $ACCOUNT_ID #keylength needs to correspond with default (or override) specified for CryptSecureDataAlg in template.yml
build:
commands:
# Use AWS SAM to package the application using AWS CloudFormation
- aws cloudformation package --template template.yml --s3-bucket $S3_BUCKET --output-template template-export.yml
# Update the AWS Partition, AWS Region, account ID and project ID in the project ARN in template-configuration.json file so AWS CloudFormation can tag project resources.
- sed -i.bak 's|\$PARTITION\$|'${PARTITION}'|g;s|\$AWS_REGION\$|'${AWS_REGION}'|g;s|\$ACCOUNT_ID\$|'${ACCOUNT_ID}'|g;s|\$PROJECT_ID\$|'${PROJECT_ID}'|g;s|\$PROJECT_STAGE_ID\$|'${PROJECT_STAGE_ID}'|g;s|\$DEPLOY_ENVIRONMENT\$|'${DEPLOY_ENVIRONMENT}'|g;s|\$DEPLOY_STAGE\$|'${DEPLOY_STAGE}'|g' template-configuration.json
artifacts:
files:
- template-export.yml
- template-configuration.json