Skip to content
This repository was archived by the owner on Feb 20, 2023. It is now read-only.

Commit 0f4b514

Browse files
committed
Run tests in travis, extend readme
1 parent 3d1a833 commit 0f4b514

File tree

2 files changed

+29
-8
lines changed

2 files changed

+29
-8
lines changed

.travis.yml

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,33 @@
11
os: linux
2-
language: generic
2+
language: node_js
3+
4+
node_js:
5+
- 10
36

47
services:
58
- docker
69

710
before_install:
811
# Cloudfront edge lambdas support nodejs up to 10.x
912
- docker pull mageops/aws-lambda-build:nodejs10.x
13+
- curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version version-number
14+
- export PATH="$HOME/.yarn/bin:$PATH"
1015

1116
env:
1217
- LAMBDA_RUNTIME=nodejs-yarn
1318

14-
script: >
15-
docker run \
16-
--rm \
17-
--tty \
18-
--volume "$(pwd):/var/app" \
19-
mageops/aws-lambda-build:nodejs10.x $LAMBDA_RUNTIME edge-lambda-deploy-package
19+
jobs:
20+
include:
21+
- stage: test
22+
script: yarn && yarn test && rm -rf node_modules
23+
24+
- stage: build
25+
script: >
26+
docker run \
27+
--rm \
28+
--tty \
29+
--volume "$(pwd):/var/app" \
30+
mageops/aws-lambda-build:nodejs10.x $LAMBDA_RUNTIME edge-lambda-deploy-package
2031
2132
deploy:
2233
- provider: releases

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@
77
- Using AWS CloudFront as a CDN server.
88
- Docker and [email protected] for development.
99

10+
1011
## Setting up
1112

12-
### Generating deploy package
13+
### Use prebuilt deploy packages
14+
15+
If you don't need to modify the code you can use the prebuilt deploy packages
16+
provided as _assets_ with each [GitHub release](https://github.com/mageops/aws-lambda-cloudfront-edge/releases).
17+
18+
They are built automatically using [Travis CI](https://travis-ci.com/mageops/aws-lambda-cloudfront-edge).
19+
20+
### Build lambda deploy package (optional)
1321

1422
Because our lambda requires native modules in npm packages e.g. for image optimization, compression etc. we need to rebuild entire `node_modules` on the same operating system that AWS Lambda is running on. Then the complete codebase is zipped into `edge-lambda-deploy-package.zip` archive which can be attached in Lambda Management Console.
1523

@@ -80,3 +88,5 @@ You will be redirected to function configuration, there you need to setup the fo
8088
10. Confirm by clicking the `Add` button.
8189
11. Hit `Save` button at the top-right.
8290
12. Wait for CloudFront to apply the changes(usually a minute or two).
91+
92+

0 commit comments

Comments
 (0)