Clairlune
Clairlune is a tool to package AWS Lambda function with npm modules for deployment.
Overview
AWS Lambda is very useful but we have to build native npm modules in Amazon Linux environment when we want to use these modules.
Clairlune consits of a Lambda function (Node.js) and Ruby code. The function is invoked to build npm modules, and upload it to S3 bucket.
Ruby code provides the interface to use the Lambda function. So the building process can be integrated to Ruby program, Rake task, Rails application etc.
Requirements
- AWS credential
- Ruby 2.3+
Installation
- Execute
$ npm install
in ./lambda/clairlune directory. - Zip ./lambda/clairlune directory and upload it to Lambda.
TODO: Create installer
Usage
In Ruby code
require 'clairlune'
builder = Clairlune::Builder.new(
bucket: 'my-awesome-bucket',
key: 'npm_modules.zip',
package_json: '/path/to/package.json',
function_name: 'clairlune',
dest: '/path/to/node_modules.zip',
)
builder.performe
As CLI tool
TODO: Not yet implemented CLI interface.
Progress report
- [x] Lambda function to build npm modules
- [x] Core toolkit with Ruby
- [ ] Installer
- [ ] CLI interface
- [ ] Documentation
License
MIT
Contributing
- Fork it ( https://github.com/mozamimy/clairlune/fork )
- Create your feature branch (
git checkout -b awesome-feature
) - Commit your changes (
git commit -am 'Add an awesome feature'
) - Push to the branch (
git push origin awesome-feature
) - Create a new Pull Request