This repository has been archived by the owner on Dec 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
.travis.yml
71 lines (57 loc) · 4.92 KB
/
.travis.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
language: node_js
services: docker
node_js: 6.10
env:
global:
- AWS_ACCESS_KEY_ID=AKIAJSKPE7ZXOFH3THUA
- AWS_DEFAULT_REGION=ap-southeast-2
- LAMBDA_NAME=snsToSlack
- LAMBDA_ALIAS=prod
# SLACK_HOOK
- secure: BWIrpqiAXPdZApDpcNPaQiib5D/9S+jPAhns812V17dlRE42ljY/Impz8bmOJIYpcFlg4lT4PTlD0po1rk3gGRGXDou9JSXZ00G2AMDxYgKpTtMkGXrQYXeS4o39fMtntI+c4STqFb8Plr13Cfy++hC1u/CxN+tNqpISSk4W1NvWS96EzgsSKLTd1DnRrBTWGFo7J99bdm3q+UCBR7zWlRG0Z4wd8oODNC+hlWlsfyHDcuZvFh+XrdoFALURytVl4Ju/xvXXQfNmCNuEbmmcmFbfS/8tKEvzt58AE/FLBhhhEkEvOE/zsJ7A3mq4ZBZetm9oguZ0CkvqY9EFOmGmLko7vNyYyic2dJ4fCp7oHEATcHN2fECJnXzvcyoVSPv4/aIRXIQN9m0/7tJwvB/fK0GfZWBlDajSSTezFxZhI+fPMMvsE5EgdyYS5AV/FJefKbiPrkz5v6loRAuWutXaWh5tEa0ASuL4378UmlMFztTFzlP9p3QvcWyHbh6p+VWCMTvZ+fiYylXN4/bYxUrlKwGIj/pMACbGBFwnKV3rmi08n+4GrCUfktuJsbWTCHzEFKgX4xR/20uqs/C+cDL96cTqDdfQhhC2FSPNcyrBYDs/aZ9wCQsIQqlMnYRFUDnFY2mtMqrF3zANXel6jbZclPZ84X8X7ThnRGg4J5musNo=
# AWS_SECRET_ACCESS_KEY
- secure: Sm3Q7Vc9KepcqxKt7OELeJd5CjuUzNbk0GdZYK6JObLOEacOwJXScxZwLPvvUFPo52q7xSbL3EdkadfDgk8GMOTdSaBtdf2drYNvq7MMGpT6X3YBQcBfEFwH07Ju5uvjbpCFvXk2B8mSEI88inbtY6IXvSZOmL1QZ13Y19hVySS7Juqx+kd6sizPmhBDrOUbpp6OkBUGLED5X05jD3dbJjyGLTnhBROXBQHt+09I8/o074esJXTcLEiByVr0rFy1aRJcJVMb+LV2nm9u/1DfRGE2uhcTc8JGPtja43SfC0BeI/UvVS4oxjZR2L1QHQiTyARFkoZ58AsGZqbi+n/Qzxy1D6Q43u6JXeJXkQD3YPeuLBKsO/N2QjIcfQzHeYqqAPV0rey9JF1+sHwShsTrKOeNwvL5MnvH7rwnH4y9EKmLoAwSv6zWCYGSSUMv5OpceuY3Sq9pAnol12t3TRGS9LA30M8Qtf1oPMPe1bOeoSfc2+dqWEJuHzcY2RhykWfqNJBf+iN8U0YI+i+UZxIs9HhwjkJIXUftLXBM9GwNDio0eyddYiAqXRxvbwFYuQXlwBFNr5mkJb2R3MvsnmrawGRAmPCST69K9rzcY8yxjqxxvQ2BW/6UDRg9AlUGBhnmpZL7aLBEU84kdiyxme6KGBG0rQqgEOt9auNES6lM7VE=
cache:
yarn: true
directories:
- node_modules
install: yarn
script:
- yarn lint
- yarn test
before_deploy: rm -rf coverage node_modules tests .*rc.js && yarn --prod
deploy:
- provider: lambda
publish: true
function_name: $LAMBDA_NAME
region: $AWS_DEFAULT_REGION
role: arn:aws:iam::873114526714:role/genericLambdaRole
description: Sends SNS notifications to a Slack channel.
runtime: nodejs6.10
timeout: 30
handler_name: handler
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key:
secure: q/1vuoGHCi0E5nBSb61pfRo4Zr+lJYbj/imA7evZ15Z+DLmdci9GN4U2A1v3L9/O96D2evMKJ1cRFDEkhfLXZnvjQbi5v39/cbV+gLvQILP8zK2B8JhURuR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r7ysYhlkbZ+pRfPZrJ/IJpB78DxSPHGZNep70S3LVcOPeSgSGAZscl4hkEEwbN5BBZ6bakriLKJZkjgO8UTPX//8X0Zg3m7Q3oMOcqw+IGasH0wOV1qOUbQNJObVy5JVFyRGnMaNDlxUWSknyc9+OO2R2ztbhImwTixN5Z4a1xEywcQQDSKzD8AbmEjgcgIAnqzOkOlP+Gz/KBVMRvXMGC7JJRotBYmqoDA=
skip_cleanup: true
on:
branch: master
tags: true
after_deploy:
# Set a Lambda alias to the most recently deployed version.
- pip install awscli --upgrade --user
- export MOST_RECENT=$(aws lambda list-versions-by-function --function "${LAMBDA_NAME}" --max-items 10000 | node -e "let stdin=''; process.stdin.on('data',(chunk)=>{stdin+=chunk}).on('end',()=>{console.log(JSON.parse(stdin).Versions.pop().Version)})")
- aws lambda update-alias --function-name "${LAMBDA_NAME}" --name "${LAMBDA_ALIAS}" --function-version "${MOST_RECENT}"
notifications:
email: false
slack:
on_start: always
rooms:
- secure: KICc5h5iDu8RZIlvrhDx7jPYHKzB5s4Fj6eDZNuBDW73s46uN7bey/D4Yx3IFb7SqfU1x59V3D7rw74hdxeY1YqnAHD485/uA1fsudogWHX++lsIFl22PCcLKQT7TQEJq3YdC32WLdleSe8GBQn5fNQtZTUnFZlHHhdmA3JH2YUFb9OyJldzwavHhHOJDpvkYrBgr5sYWHsu3bvyzzlAPtQWEBqxhItA0h8mc3g5ROmYOd9G4PDt31qAbnyzAP+OlaF5OkUxWXKMh7WCvT+yCpfvsjRkWKbo5mIzI5A3lxEhjdRMuCj/NUIfKSuVJPXZvEi3k14gDytndg6HDLaIIFfMyf56l6JpByp2FBIQ71nSxLo7YG59sM0y3M3CsVQcF574njGUuCoPvIKpOIZRjm/ZL9MoUw8Zl/TaPHg9ECn1hDN2eP0QO+o0EjKdJgfq0K/HNcZlKUOnc9SZW1e8vUyenplNtN4NiIX4FKI4Zr0IdXkDEIZxolRiv7TOhisEzoN2HnVOhPk21mrOD8h+DC7bevTLq7YYVsYRxIfF7vTtXlrkMOCDZd2HH2pa4tTsNhesGUdgpYCs+lAQfTjcxv0uwgN+leikoCeeg5WBLGBMxUdWRX0kGgt2qVyU4FEjYwAsZ9eWUptVoY/AZsgXZiQdVWuiEzvR2DrbnlUWrTQ=