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 1
/
.travis.yml
109 lines (86 loc) · 6.19 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
language: node_js
services: docker
node_js: 6.10
env:
global:
- AWS_ACCESS_KEY_ID=AKIAIETZ7UTECKLYJJYQ
- AWS_DEFAULT_REGION=ap-southeast-2
- LAMBDA_NAME=sftpToPapertrail
- LAMBDA_ALIAS=prod
- STP_SFTP_HOST=appserver.dev.aea704e1-f89f-4a49-a160-c0d9a71c4671.drush.in
- STP_SFTP_PORT=2222
- STP_SFTP_USERNAME=dev.aea704e1-f89f-4a49-a160-c0d9a71c4671
- STP_SFTP_PATH=logs/nginx-access.log,logs/nginx-error.log,logs/php-fpm-error.log,logs/php-slow.log
- STP_S3_BUCKET=aws-admin-timmalone
- STP_PAPERTRAIL_HOST=logs5.papertrailapp.com
# STP_SFTP_PASSWORD
- secure: RK11+6XQmexZeCAaIDoJ5/bdMRfptsj2Pqgfd9qIs6EIai+N133OnGPpOqnIDbwd9MV3U/yfjfp4N+HqIgl6BHV9gr8Lg9DK16+6nY7j9dxeV6izDSE8JvA2EahBKtU+Ir06J/0pGwMd06XLh8GFRA+dMUOJ02nD4fS01MUxNlPThuF31u2nPcoZfcpxpGpWDcuH/KprlzL1oUMjDmuu2H4Fz1Oi+gffECVg01tO6gDu1y3swXFf3qDEB1SJKN74QKmli1byZsdKox3no3f02ZDhZp4gABBOROVYz5Tzy0tBq++6Qbj84ZUD00xu+Fv1lXAozKFJILDI/KOdfCg8zCm0K6IQPCensz/GWiU4N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iSTCOflzfx5vYprZhjjB8Oxibud6b78VpaijBkuW5vSg55Daqm0Br0unmx+3Bu/Yf+NUwtO2m6QJSp+lioJ9ect2lUdBkif/T/OyKFvBe24yNiqVuITZvKZUABVo187N78HYVe34cU4e0w+WSJuMfAy1hx7l9eBdMOqlOWdu+9qYqitimvN0RmluSWf9iCI8a8cDxaE6h+bAZqIwVewwIuek2LrkJbTffKSCikbD8QaSNhUdm/Vpo9mumhegHSFnJYB4pWHOtVoq+aTx3w19hqO0/V+QaZstnBFEtWQDg5qj1GM6jc9jbl/YmEOK46Ng3oUU9SZOJZAkbGzchYSQrfb8mNr676qmH+63yrk1VlpA725YImdgBIAY3WKtlQcwsrrvUwK7hHH+698ZCkFl7xMtGjSPVCxuTh+Y+t8q++ZFF/cFvWfgVfl+gA/Z0iBpOoR+wdHpYdOqIhW1f0yBjQORleg5XOz7Qv5fNRLBm/2J4mZdirVlbVOFfbG7A0Z+2bUge15qdH7aFmRYxmpMqfQaNE6FXuXIJKc7UNRMMBnsWpGxVtEI0oUvwb5ZE271COfKGbyehT0lglkdTDwgk0w5b8OaIkTnvajKSR1mpo+bpZOwOkEVeMpWBNr91wRA6FdjnpOwFID4l4n7N1xFemWA=
cache:
yarn: true
directories:
- node_modules
install: yarn
script:
- yarn lint
- yarn test
before_deploy: rm -rf node_modules && yarn --prod && rm -rf tests .*rc.js
before_deploy: yarn remove aws-sdk && rm -rf coverage node_modules tests .*rc.js && yarn --prod
deploy:
# Deploy to $LATEST on dev branch. (i.e. don't publish a new version).
- on:
branch: dev
publish: false
provider: lambda
function_name: $LAMBDA_NAME
region: $AWS_DEFAULT_REGION
role: arn:aws:iam::873114526714:role/genericLambdaRole
description: Retrieves log files via SFTP, and logs new entries to Papertrail.
runtime: nodejs6.10
timeout: 120
handler_name: handler
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
# Deploy and publish a new version on master branch.
- on:
branch: master
publish: true
provider: lambda
function_name: $LAMBDA_NAME
region: $AWS_DEFAULT_REGION
role: arn:aws:iam::873114526714:role/genericLambdaRole
description: Retrieves log files via SFTP, and logs new entries to Papertrail.
runtime: nodejs6.10
timeout: 120
handler_name: handler
access_key_id: $AWS_ACCESS_KEY_ID
secret_access_key: $AWS_SECRET_ACCESS_KEY
skip_cleanup: true
# Deploy to npm on master with a new tag.
- on:
branch: master
tags: true
provider: npm
email: [email protected]
api_key:
secure: fdg6DUS+Zg3mi3saDcbp4Ns++9B0sgJpSuEDfq/j1InwRYNhJSQmrpzHj1ci2ngmfkEpuKkHTLGC6rRFIO++Q0A0sUblbbEIpBbSgkH2ASzeSTM83d31CK/mq3/hrGSfFa0jo3boZdMf2bQpoaZuWnpe1ZfMjJaWr57BY2VNAFucKyfdgKsb93ZS8AoVREYcePDtPgZ/Ed6A9r/ByCP6TTZhkxltZU4XSpkPMJ0HRG+HNlTzc+DN79Q7PUNMnc4d39p7H4nFzdBuUjyKbpF3G6ppb3w707RKwIUelbo8Q1bEn13al0HWRsramqyQfe6lp25Ej88hSZrHreKT0rVpip7cAJB4adojr4L3h5pRyYixtSvXLIgfy/T+RkQ1eeLrfzjHvviGqF9ajQL34YNyC7BGuBny0RlmjCsH+Z96idgBFi6P6r2ZHpvWkK3UAZzM6veA9K6FetNmOn70nIZBUJWMCxOWPGb221EbqRHlp+CGvC/Xj+1rlrt0aNRZNh6wMCLIS0NZi3Jxy18P0poLjf9ZNcaIB90MH9cNjhdK4FE8JiY0NIoocYQ1vtzcLlq0oj/hi8npcnVupMj6nj+/7t8sw4o9JK6RkK0UOJaPtxQxxSTDUyg8n7VqdW6OblwMfDFKFUnj5C/PIf6lDVmX2QFLw0cM6VeFxuVNz92b0DI=
skip_cleanup: true
after_deploy:
# Set a Lambda alias to the most recently deployed version.
- if [ "master" = "${TRAVIS_BRANCH}" ]; then
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}";
fi;
notifications:
email: false
webhooks:
urls: https://api.tm.id.au/v2/travis/jobStatus
slack:
on_start: always
rooms:
- secure: uJ/pVszSOwliIpoc+LBSy/6bs5cAR0GqrycWvYkpmrRdY/Yk96kQtDLKnafYCsJc/veMMOIL3O+KRVnO+tX4BHcNBuVWNowgAaoHCPIqdfzwjG/7m+G6rW1rKmeduc05gAZLlZu4WWWHagin3MHdjtHcTTsL2MhK98K8C/YFkqKOvRWtV+KgU0+/Ij5h5qwofA7qd808Et42rlhAV1Fd//cjcNGw7SRI/IDGnofynoVPNAydT3oGVncPGDnQvd59PVHe41x3dcLwsPG0wgd6NcgBn0g+4mkUtJ+JpnhnNbZYTyeHvCDeOTysH5IvbDqbiq8bS386nBkT1yFYpfRBF4PFv0BDpt5Zt1vkdHmgj1ns6koolTUq6dO+gzLUq52yFKvQXb2jXMUFg/hNGJN7RMq/ke6NuMH/mKVD1iIq3bbZq77b//vV8YPVqwQt0jjvTFF36yS+u6nwVbinQSBpgi9T7kCm6AA24FuVrdN7wV0jcIqY0VGTEeg8CE+NZmdL/SL6Cxl0WwBZu2tnm8N+CwEsuNUPQLZKBkVud9YdAFzNUvE0keorhcRl4ZB6QHYVmFss2WPt7XdusKc/94M30X0HQ1xMgHWha7gtNi0s9HikTVXQjDq9iXQMiS0ZBghGPo/Dx3zSo01eyOVzD0xTLss8Bf4znAlEHfARENjgIFg=