Lambda handler to automatically publish Lambda functions when a new source is uploaded to S3. Installation is handled by AWS Cloudformation so don't worry.
To get started:_
$ bash ./bin/create-stack.sh --help
Features:
- Automated unit tests with Grunt and Buster.js.
- Code coverage with Istanbul and reports to Coveralls.io
- Code style and hits with JSCS and JSHint.
- CI integration with Travis.
- Automated deployment to AWS S3 with Travis.
- And last but not least; deployment with AWS CloudFormation
Lambda function name has to be equal to base filename:
"hello-world.zip" will try to update a Lambda function with the name "hello-world"
$ aws s3api create-bucket --profile ife --bucket aws-lambda-static --region eu-west-1 --create-bucket-configuration LocationConstraint=eu-west-1
$ npm install
$ grunt build
# To create a new stack:
$ bash ./bin/create-stack.sh
# To update a current stack:
$ bash ./bin/create-stack.sh -u
To get auto deployment to S3 working you need to integrate with Travis CI.
- Connect your Github.com repo to your Travis CI account. https://travis-ci.org/
- Add
AWS_ACCESS_KEY
andAWS_SECRET_KEY
to your Travis CI environment. - Edit
.travis.yml
to match yourbucket
,upload-dir
andregion
. - Copy
.coveralls-dist.yml
to.coveralls.yml
and add you secret key.
Next time you push to your master branch Travis will run your tests and if all is green deploy the code to your S3 bucket.
Isn't this great? :D
$ cp ./bin/set-env-dist.sh ./bin/set-env.sh
$ . ./bin/set-env.sh
$ grunt watch
# Install Node Security Platform CLI
$ npm install nsp --global
# From inside your project directory
$ nsp check
$ npm install -g npm-check-updates
$ ncu -u
$ npm install --save --no-optional