You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Running `servleress deploy` automatically deploys the required gems as in Gemfile to AWS lambda layer and make the gems available to the `RUBY_PATH` of the functions `hello.handler`
54
+
Running `serverless deploy` automatically deploys the required gems as in Gemfile to AWS lambda layer and make the gems available to the `RUBY_PATH` of the functions `hello.handler`
44
55
45
-
Refer [here](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/basic) for example.
56
+
Refer [example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/basic) amd [docs](https://navarasu.github.io/serverless-ruby-layer) for more details
46
57
47
-
## Customization
58
+
### Customization
48
59
49
-
### Using docker for gems with OS specific C extentions
60
+
The plugin operation can be customized by specifying the `custom` configuration under `rubyLayer`.
50
61
51
-
*`serverless.yml`*
62
+
For example, to use docker environment for packing gem, the below configuration is added to `serverless.yml`
52
63
53
64
```YML
54
-
service: basic
55
-
56
-
plugins:
57
-
- serverless-ruby-layer
58
-
59
65
custom:
60
66
rubyLayer:
61
67
use_docker: true
68
+
```
62
69
63
-
provider:
64
-
name: aws
65
-
runtime: ruby2.5
70
+
For more details, refer the docs [here](https://navarasu.github.io/serverless-ruby-layer/#/configuration)
66
71
67
-
functions:
68
-
hello:
69
-
handler: handler.hello
70
-
```
71
72
72
-
*`Gemfile`*
73
+
## Usage
74
+
75
+
Using the custom configuration, the plugin can be utilized for below cases,
76
+
* Using locallly installed bundler for gems which native extensions - [Example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/basic) - [Docs](https://navarasu.github.io/serverless-ruby-layer/#/use_local_bundler)
77
+
* Using Docker for gems with OS native C extensions or system libraries like `http`, `Nokogiri` - [Example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/use_docker) - [Docs](https://navarasu.github.io/serverless-ruby-layer/#/use_docker)
78
+
* Preinstall OS packages (yum packages) for gems which requires OS native system libraries like `pg`, `mysql`, `RMagick` - [Example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/use_docker_with_yums) - [Docs](https://navarasu.github.io/serverless-ruby-layer/#/use_docker_with_yums)
79
+
* Using Dockerfile for gems which with other OS Linux image or system libraries and utilities - [Example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/use_docker_file) - [Docs](https://navarasu.github.io/serverless-ruby-layer/#/use_docker_file)
73
80
74
-
```ruby
75
-
source 'https://rubygems.org'
76
-
gem 'http'
77
-
gem 'nokogiri'
78
-
```
79
81
80
82
## Contributing
81
83
82
84
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
83
85
84
-
Please make sure to update tests as appropriate.
86
+
Please make sure to update the tests as appropriate.
Running `serverless deploy` automatically deploys the required gems as in Gemfile to AWS lambda layer and make the gems available to the `RUBY_PATH` of the functions `hello.handler`
56
+
57
+
Refer [example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/basic) amd [docs](https://navarasu.github.io/serverless-ruby-layer) for more details
58
+
59
+
### Customization
60
+
61
+
The plugin operation can be customized by specifying the `custom` configuration under `rubyLayer`.
62
+
63
+
For example, to use docker environment for packing gem, the below configuration is added to `serverless.yml`
64
+
65
+
```YML
66
+
custom:
67
+
rubyLayer:
68
+
use_docker: true
69
+
```
70
+
71
+
For more details, refer the docs [here](https://navarasu.github.io/serverless-ruby-layer/configuration)
72
+
73
+
74
+
## Usage
75
+
76
+
Using the custom configuration, the plugin can be utilized for below cases,
77
+
* Using locallly installed bundler for gems which native extensions - [Example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/basic) - [Docs](https://navarasu.github.io/serverless-ruby-layer/use_docker)
78
+
* Using Docker for gems with OS native C extensions or system libraries like `http`, `Nokogiri` - [Example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/use_docker) - [Docs](https://navarasu.github.io/serverless-ruby-layer/use_docker)
79
+
* Preinstall OS packages (yum packages) for gems which requires OS native system libraries like `pg`, `mysql`, `RMagick` - [Example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/use_docker_with_yums) - [Docs](https://navarasu.github.io/serverless-ruby-layer/use_docker_with_yums)
80
+
* Using Dockerfile for gems which with other OS Linux image or system libraries and utilities - [Example](https://github.com/navarasu/serverless-ruby-layer/blob/master/examples/use_docker_file) - [Docs](https://navarasu.github.io/serverless-ruby-layer/use_docker_file)
81
+
82
+
83
+
## Contributing
84
+
85
+
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
86
+
87
+
Please make sure to update the tests as appropriate.
0 commit comments