-
Notifications
You must be signed in to change notification settings - Fork 1
/
circle.yml
41 lines (38 loc) · 1.82 KB
/
circle.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
machine:
node:
version: $NODE_RUNTIME_VERSION
environment:
NODE_RUNTIME_VERSION: 6.10 # To be the same version AWS Lambda uses
YARN_VERSION: 0.18.1
PATH: "${PATH}:${HOME}/.yarn/bin:${HOME}/${CIRCLE_PROJECT_REPONAME}/node_modules/.bin"
AWS_DEFAULT_REGION: us-east-1
AWS_LAMBDA_PRODUCTION_ARN: arn:aws:lambda:us-east-1:750878068186:function:mtaStatus
AWS_FB_LAMBDA_PRODUCTION_ARN: arn:aws:lambda:us-east-1:750878068186:function:mtaStatusFlashBriefing
dependencies:
pre:
- |
if [[ ! -e ~/.yarn/bin/yarn || $(yarn --version) != "${YARN_VERSION}" ]]; then
echo "Download and install Yarn."
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION
else
echo "The correct version of Yarn is already installed."
fi
override:
- yarn install
cache_directories:
- ~/.yarn
- ~/.cache/yarn
test:
override:
- yarn test
deployment:
master:
branch: master
commands:
- yarn release
- 'aws lambda update-function-code --function-name $AWS_LAMBDA_PRODUCTION_ARN --zip-file fileb://subway.zip'
- 'aws lambda publish-version --function-name $AWS_LAMBDA_PRODUCTION_ARN --description "SHA: $CIRCLE_SHA1 Github: $CIRCLE_COMPARE_URL Build Number: $CIRCLE_BUILD_NUM"'
- 'aws lambda update-function-configuration --function-name $AWS_LAMBDA_PRODUCTION_ARN --runtime "nodejs${NODE_RUNTIME_VERSION}"'
- 'aws lambda update-function-code --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --zip-file fileb://subway.zip'
- 'aws lambda publish-version --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --description "SHA: $CIRCLE_SHA1 Github: $CIRCLE_COMPARE_URL Build Number: $CIRCLE_BUILD_NUM"'
- 'aws lambda update-function-configuration --function-name $AWS_FB_LAMBDA_PRODUCTION_ARN --runtime "nodejs${NODE_RUNTIME_VERSION}"'