lamby 1.0.2 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.github/workflows/cicd.yml +17 -0
- data/.gitignore +1 -1
- data/.ruby-version +1 -1
- data/CHANGELOG.md +25 -0
- data/Dockerfile +12 -0
- data/Gemfile.lock +82 -83
- data/README.md +9 -3
- data/Rakefile +1 -0
- data/bin/_setup +6 -0
- data/bin/_test +6 -0
- data/bin/bootstrap +3 -17
- data/bin/setup +3 -3
- data/bin/test +6 -3
- data/bin/update +2 -2
- data/docker-compose.yml +14 -0
- data/lamby.gemspec +1 -1
- data/lib/lamby.rb +2 -1
- data/lib/lamby/handler.rb +16 -3
- data/lib/lamby/logger.rb +13 -9
- data/lib/lamby/rack.rb +11 -9
- data/lib/lamby/rack_alb.rb +11 -14
- data/lib/lamby/rack_http.rb +80 -0
- data/lib/lamby/{rack_api.rb → rack_rest.rb} +7 -3
- data/lib/lamby/ssm_parameter_store.rb +1 -1
- data/lib/lamby/templates.rake +4 -3
- data/lib/lamby/templates/{application_load_balancer.rb → alb.rb} +1 -1
- data/lib/lamby/templates/{application_load_balancer → alb}/app.rb +0 -0
- data/lib/lamby/templates/{application_load_balancer → alb}/build +1 -1
- data/lib/lamby/templates/{application_load_balancer → alb}/deploy +1 -1
- data/lib/lamby/templates/{application_load_balancer → alb}/template.yaml +1 -1
- data/lib/lamby/templates/{api_gateway.rb → http.rb} +2 -2
- data/lib/lamby/templates/{api_gateway → http}/app.rb +1 -1
- data/lib/lamby/templates/{api_gateway → http}/build +1 -1
- data/lib/lamby/templates/{api_gateway → http}/deploy +1 -1
- data/lib/lamby/templates/http/template.yaml +48 -0
- data/lib/lamby/templates/rest.rb +25 -0
- data/lib/lamby/templates/rest/app.rb +10 -0
- data/lib/lamby/templates/rest/build +23 -0
- data/lib/lamby/templates/rest/deploy +22 -0
- data/lib/lamby/templates/{api_gateway → rest}/template.yaml +2 -2
- data/lib/lamby/templates/shared.rb +3 -1
- data/lib/lamby/version.rb +1 -1
- data/vendor/.keep +0 -0
- metadata +29 -23
- data/.python-version +0 -1
- data/.travis.yml +0 -17
- data/Brewfile +0 -5
- data/Pipfile +0 -13
- data/Pipfile.lock +0 -370
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 18326760740ee9c10fd57da1a1d2400b0a09127a65ad908e1c298473983c3c45
|
4
|
+
data.tar.gz: 379e871079160326aa6e55aed63f3822b8e2f3aa0bf3c4fedf89fdf309ae01f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a19f7f5295ccf44518f18c1d22b0a3cdf1ecea9b3ffe882ec6fb7434b296dec1ec66215f9b6d28877f70f01968036196ca23ea0086c75c3eb185af98b7699ef4
|
7
|
+
data.tar.gz: 6c509a8044e195c7b66fd923358ab2b5b2253a8138629bebea4bf17035eb44a995f55723fef5bc92b972169533c235a9afebe471267b6531ea18dc78d3f1ba60
|
@@ -0,0 +1,17 @@
|
|
1
|
+
name: CI/CD
|
2
|
+
on: [push]
|
3
|
+
jobs:
|
4
|
+
cicd:
|
5
|
+
runs-on: ubuntu-latest
|
6
|
+
steps:
|
7
|
+
- name: Checkout
|
8
|
+
uses: actions/checkout@v1
|
9
|
+
- name: Bootstrap
|
10
|
+
run: |
|
11
|
+
./bin/bootstrap
|
12
|
+
- name: Setup
|
13
|
+
run: |
|
14
|
+
./bin/setup
|
15
|
+
- name: Test
|
16
|
+
run: |
|
17
|
+
./bin/test
|
data/.gitignore
CHANGED
@@ -5,6 +5,7 @@
|
|
5
5
|
/pkg/
|
6
6
|
/spec/reports/
|
7
7
|
/tmp/
|
8
|
+
/vendor/bundle
|
8
9
|
test/dummy_app/.gitignore
|
9
10
|
test/dummy_app/app.rb
|
10
11
|
test/dummy_app/template.yaml
|
@@ -12,4 +13,3 @@ test/dummy_app/bin/build
|
|
12
13
|
test/dummy_app/bin/deploy
|
13
14
|
test/dummy_app/tmp
|
14
15
|
test/dummy_app/log/**/*
|
15
|
-
test/dummy_app/public/**/*
|
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.7.0
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,31 @@
|
|
2
2
|
|
3
3
|
See this http://keepachangelog.com link for information on how we want this documented formatted.
|
4
4
|
|
5
|
+
## v2.0.0
|
6
|
+
|
7
|
+
Support for new API Gateway HTTP APIs!!!
|
8
|
+
|
9
|
+
#### Changed
|
10
|
+
|
11
|
+
* The `Lamby.handler` must have a `:rack` option. One of `:http`, `:rest`, `:alb`.
|
12
|
+
* Renamed template generators to match options above.
|
13
|
+
* The `lamby:install` task now defaults to HTTP API.
|
14
|
+
* Changed the name of `:api` rack option to `:rest`.
|
15
|
+
* Removed `export` from Dotenv files. Better Docker compatability.
|
16
|
+
|
17
|
+
#### Added
|
18
|
+
|
19
|
+
* New reack handler for HTTP API v1 and v2.
|
20
|
+
* Lots of backfill tests for, ALBs & REST APIs.
|
21
|
+
|
22
|
+
|
23
|
+
## v1.0.3
|
24
|
+
|
25
|
+
#### Changed
|
26
|
+
|
27
|
+
* Change shebangs to `#!/usr/bin/env bash`
|
28
|
+
|
29
|
+
|
5
30
|
## v1.0.2
|
6
31
|
|
7
32
|
#### Changed
|
data/Dockerfile
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
FROM lambci/lambda:build-ruby2.7
|
2
|
+
|
3
|
+
# Lock down AWS SAM version.
|
4
|
+
RUN pip install awscli && \
|
5
|
+
pip uninstall --yes aws-sam-cli && \
|
6
|
+
pip install aws-sam-cli==0.45.0
|
7
|
+
|
8
|
+
# Asset Pipeline
|
9
|
+
RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash - && \
|
10
|
+
yum install -y nodejs
|
11
|
+
|
12
|
+
WORKDIR /var/task
|
data/Gemfile.lock
CHANGED
@@ -1,141 +1,141 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
lamby (
|
4
|
+
lamby (2.0.0)
|
5
5
|
rack
|
6
6
|
rails
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
actioncable (6.0.
|
12
|
-
actionpack (= 6.0.
|
11
|
+
actioncable (6.0.2.2)
|
12
|
+
actionpack (= 6.0.2.2)
|
13
13
|
nio4r (~> 2.0)
|
14
14
|
websocket-driver (>= 0.6.1)
|
15
|
-
actionmailbox (6.0.
|
16
|
-
actionpack (= 6.0.
|
17
|
-
activejob (= 6.0.
|
18
|
-
activerecord (= 6.0.
|
19
|
-
activestorage (= 6.0.
|
20
|
-
activesupport (= 6.0.
|
15
|
+
actionmailbox (6.0.2.2)
|
16
|
+
actionpack (= 6.0.2.2)
|
17
|
+
activejob (= 6.0.2.2)
|
18
|
+
activerecord (= 6.0.2.2)
|
19
|
+
activestorage (= 6.0.2.2)
|
20
|
+
activesupport (= 6.0.2.2)
|
21
21
|
mail (>= 2.7.1)
|
22
|
-
actionmailer (6.0.
|
23
|
-
actionpack (= 6.0.
|
24
|
-
actionview (= 6.0.
|
25
|
-
activejob (= 6.0.
|
22
|
+
actionmailer (6.0.2.2)
|
23
|
+
actionpack (= 6.0.2.2)
|
24
|
+
actionview (= 6.0.2.2)
|
25
|
+
activejob (= 6.0.2.2)
|
26
26
|
mail (~> 2.5, >= 2.5.4)
|
27
27
|
rails-dom-testing (~> 2.0)
|
28
|
-
actionpack (6.0.
|
29
|
-
actionview (= 6.0.
|
30
|
-
activesupport (= 6.0.
|
31
|
-
rack (~> 2.0)
|
28
|
+
actionpack (6.0.2.2)
|
29
|
+
actionview (= 6.0.2.2)
|
30
|
+
activesupport (= 6.0.2.2)
|
31
|
+
rack (~> 2.0, >= 2.0.8)
|
32
32
|
rack-test (>= 0.6.3)
|
33
33
|
rails-dom-testing (~> 2.0)
|
34
34
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
35
|
-
actiontext (6.0.
|
36
|
-
actionpack (= 6.0.
|
37
|
-
activerecord (= 6.0.
|
38
|
-
activestorage (= 6.0.
|
39
|
-
activesupport (= 6.0.
|
35
|
+
actiontext (6.0.2.2)
|
36
|
+
actionpack (= 6.0.2.2)
|
37
|
+
activerecord (= 6.0.2.2)
|
38
|
+
activestorage (= 6.0.2.2)
|
39
|
+
activesupport (= 6.0.2.2)
|
40
40
|
nokogiri (>= 1.8.5)
|
41
|
-
actionview (6.0.
|
42
|
-
activesupport (= 6.0.
|
41
|
+
actionview (6.0.2.2)
|
42
|
+
activesupport (= 6.0.2.2)
|
43
43
|
builder (~> 3.1)
|
44
44
|
erubi (~> 1.4)
|
45
45
|
rails-dom-testing (~> 2.0)
|
46
46
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
47
|
-
activejob (6.0.
|
48
|
-
activesupport (= 6.0.
|
47
|
+
activejob (6.0.2.2)
|
48
|
+
activesupport (= 6.0.2.2)
|
49
49
|
globalid (>= 0.3.6)
|
50
|
-
activemodel (6.0.
|
51
|
-
activesupport (= 6.0.
|
52
|
-
activerecord (6.0.
|
53
|
-
activemodel (= 6.0.
|
54
|
-
activesupport (= 6.0.
|
55
|
-
activestorage (6.0.
|
56
|
-
actionpack (= 6.0.
|
57
|
-
activejob (= 6.0.
|
58
|
-
activerecord (= 6.0.
|
50
|
+
activemodel (6.0.2.2)
|
51
|
+
activesupport (= 6.0.2.2)
|
52
|
+
activerecord (6.0.2.2)
|
53
|
+
activemodel (= 6.0.2.2)
|
54
|
+
activesupport (= 6.0.2.2)
|
55
|
+
activestorage (6.0.2.2)
|
56
|
+
actionpack (= 6.0.2.2)
|
57
|
+
activejob (= 6.0.2.2)
|
58
|
+
activerecord (= 6.0.2.2)
|
59
59
|
marcel (~> 0.3.1)
|
60
|
-
activesupport (6.0.
|
60
|
+
activesupport (6.0.2.2)
|
61
61
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
62
62
|
i18n (>= 0.7, < 2)
|
63
63
|
minitest (~> 5.1)
|
64
64
|
tzinfo (~> 1.1)
|
65
|
-
zeitwerk (~> 2.
|
66
|
-
aws-eventstream (1.0.
|
67
|
-
aws-partitions (1.
|
68
|
-
aws-sdk-core (3.
|
65
|
+
zeitwerk (~> 2.2)
|
66
|
+
aws-eventstream (1.0.3)
|
67
|
+
aws-partitions (1.287.0)
|
68
|
+
aws-sdk-core (3.92.0)
|
69
69
|
aws-eventstream (~> 1.0, >= 1.0.2)
|
70
|
-
aws-partitions (~> 1.0)
|
70
|
+
aws-partitions (~> 1, >= 1.239.0)
|
71
71
|
aws-sigv4 (~> 1.1)
|
72
72
|
jmespath (~> 1.0)
|
73
|
-
aws-sdk-ssm (1.
|
74
|
-
aws-sdk-core (~> 3, >= 3.
|
73
|
+
aws-sdk-ssm (1.73.0)
|
74
|
+
aws-sdk-core (~> 3, >= 3.71.0)
|
75
75
|
aws-sigv4 (~> 1.1)
|
76
|
-
aws-sigv4 (1.1.
|
76
|
+
aws-sigv4 (1.1.1)
|
77
77
|
aws-eventstream (~> 1.0, >= 1.0.2)
|
78
|
-
builder (3.2.
|
78
|
+
builder (3.2.4)
|
79
79
|
coderay (1.1.2)
|
80
|
-
concurrent-ruby (1.1.
|
81
|
-
crass (1.0.
|
80
|
+
concurrent-ruby (1.1.6)
|
81
|
+
crass (1.0.6)
|
82
82
|
erubi (1.9.0)
|
83
83
|
globalid (0.4.2)
|
84
84
|
activesupport (>= 4.2.0)
|
85
|
-
i18n (1.
|
85
|
+
i18n (1.8.2)
|
86
86
|
concurrent-ruby (~> 1.0)
|
87
87
|
jmespath (1.4.0)
|
88
|
-
loofah (2.
|
88
|
+
loofah (2.4.0)
|
89
89
|
crass (~> 1.0.2)
|
90
90
|
nokogiri (>= 1.5.9)
|
91
91
|
mail (2.7.1)
|
92
92
|
mini_mime (>= 0.1.1)
|
93
93
|
marcel (0.3.3)
|
94
94
|
mimemagic (~> 0.3.2)
|
95
|
-
|
96
|
-
|
97
|
-
mimemagic (0.3.3)
|
95
|
+
method_source (1.0.0)
|
96
|
+
mimemagic (0.3.4)
|
98
97
|
mini_mime (1.0.2)
|
99
98
|
mini_portile2 (2.4.0)
|
100
|
-
minitest (5.
|
101
|
-
|
102
|
-
|
99
|
+
minitest (5.14.0)
|
100
|
+
minitest-focus (1.1.2)
|
101
|
+
minitest (>= 4, < 6)
|
102
|
+
mocha (1.11.2)
|
103
103
|
nio4r (2.5.2)
|
104
|
-
nokogiri (1.10.
|
104
|
+
nokogiri (1.10.9)
|
105
105
|
mini_portile2 (~> 2.4.0)
|
106
|
-
pry (0.
|
107
|
-
coderay (~> 1.1
|
108
|
-
method_source (~>
|
109
|
-
rack (2.
|
106
|
+
pry (0.13.0)
|
107
|
+
coderay (~> 1.1)
|
108
|
+
method_source (~> 1.0)
|
109
|
+
rack (2.2.2)
|
110
110
|
rack-test (1.1.0)
|
111
111
|
rack (>= 1.0, < 3)
|
112
|
-
rails (6.0.
|
113
|
-
actioncable (= 6.0.
|
114
|
-
actionmailbox (= 6.0.
|
115
|
-
actionmailer (= 6.0.
|
116
|
-
actionpack (= 6.0.
|
117
|
-
actiontext (= 6.0.
|
118
|
-
actionview (= 6.0.
|
119
|
-
activejob (= 6.0.
|
120
|
-
activemodel (= 6.0.
|
121
|
-
activerecord (= 6.0.
|
122
|
-
activestorage (= 6.0.
|
123
|
-
activesupport (= 6.0.
|
112
|
+
rails (6.0.2.2)
|
113
|
+
actioncable (= 6.0.2.2)
|
114
|
+
actionmailbox (= 6.0.2.2)
|
115
|
+
actionmailer (= 6.0.2.2)
|
116
|
+
actionpack (= 6.0.2.2)
|
117
|
+
actiontext (= 6.0.2.2)
|
118
|
+
actionview (= 6.0.2.2)
|
119
|
+
activejob (= 6.0.2.2)
|
120
|
+
activemodel (= 6.0.2.2)
|
121
|
+
activerecord (= 6.0.2.2)
|
122
|
+
activestorage (= 6.0.2.2)
|
123
|
+
activesupport (= 6.0.2.2)
|
124
124
|
bundler (>= 1.3.0)
|
125
|
-
railties (= 6.0.
|
125
|
+
railties (= 6.0.2.2)
|
126
126
|
sprockets-rails (>= 2.0.0)
|
127
127
|
rails-dom-testing (2.0.3)
|
128
128
|
activesupport (>= 4.2.0)
|
129
129
|
nokogiri (>= 1.6)
|
130
130
|
rails-html-sanitizer (1.3.0)
|
131
131
|
loofah (~> 2.3)
|
132
|
-
railties (6.0.
|
133
|
-
actionpack (= 6.0.
|
134
|
-
activesupport (= 6.0.
|
132
|
+
railties (6.0.2.2)
|
133
|
+
actionpack (= 6.0.2.2)
|
134
|
+
activesupport (= 6.0.2.2)
|
135
135
|
method_source
|
136
136
|
rake (>= 0.8.7)
|
137
137
|
thor (>= 0.20.3, < 2.0)
|
138
|
-
rake (
|
138
|
+
rake (13.0.1)
|
139
139
|
sprockets (4.0.0)
|
140
140
|
concurrent-ruby (~> 1.0)
|
141
141
|
rack (> 1, < 3)
|
@@ -143,15 +143,14 @@ GEM
|
|
143
143
|
actionpack (>= 4.0)
|
144
144
|
activesupport (>= 4.0)
|
145
145
|
sprockets (>= 3.0.0)
|
146
|
-
|
147
|
-
thor (0.20.3)
|
146
|
+
thor (1.0.1)
|
148
147
|
thread_safe (0.3.6)
|
149
|
-
tzinfo (1.2.
|
148
|
+
tzinfo (1.2.6)
|
150
149
|
thread_safe (~> 0.1)
|
151
150
|
websocket-driver (0.7.1)
|
152
151
|
websocket-extensions (>= 0.1.0)
|
153
152
|
websocket-extensions (0.1.4)
|
154
|
-
zeitwerk (2.
|
153
|
+
zeitwerk (2.3.0)
|
155
154
|
|
156
155
|
PLATFORMS
|
157
156
|
ruby
|
@@ -161,10 +160,10 @@ DEPENDENCIES
|
|
161
160
|
bundler
|
162
161
|
lamby!
|
163
162
|
minitest
|
163
|
+
minitest-focus
|
164
164
|
mocha
|
165
165
|
pry
|
166
166
|
rake
|
167
|
-
sqlite3
|
168
167
|
|
169
168
|
BUNDLED WITH
|
170
|
-
1.
|
169
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
|
2
|
-
# Lamby [](https://github.com/customink/lamby/actions)
|
3
3
|
|
4
4
|
<h2>Simple Rails & AWS Lambda Integration</h2>
|
5
5
|
|
@@ -11,7 +11,7 @@ The goal of this project is to provide minimal code to allow your Rails applicat
|
|
11
11
|
|
12
12
|
```ruby
|
13
13
|
def handler(event:, context:)
|
14
|
-
Lamby.handler $app, event, context, rack: :
|
14
|
+
Lamby.handler $app, event, context, rack: :http
|
15
15
|
end
|
16
16
|
```
|
17
17
|
|
@@ -27,7 +27,13 @@ https://lamby.custominktech.com/docs/installing_aws_sam
|
|
27
27
|
|
28
28
|
## Contributing
|
29
29
|
|
30
|
-
After checking out the repo, run
|
30
|
+
After checking out the repo, run:
|
31
|
+
|
32
|
+
```shell
|
33
|
+
$ ./bin/bootstrap
|
34
|
+
$ ./bin/setup
|
35
|
+
$ ./bin/test
|
36
|
+
```
|
31
37
|
|
32
38
|
Bug reports and pull requests are welcome on GitHub at https://github.com/customink/lamby. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
33
39
|
|
data/Rakefile
CHANGED
data/bin/_setup
ADDED
data/bin/_test
ADDED
data/bin/bootstrap
CHANGED
@@ -1,20 +1,6 @@
|
|
1
1
|
#!/bin/bash
|
2
|
-
|
3
2
|
set -e
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
brew bundle --verbose
|
9
|
-
}
|
10
|
-
fi
|
11
|
-
|
12
|
-
rbenv install \
|
13
|
-
--skip-existing \
|
14
|
-
$(cat .ruby-version)
|
15
|
-
|
16
|
-
CFLAGS="-I$(brew --prefix zlib)/include" \
|
17
|
-
LDFLAGS="-L$(brew --prefix zlib)/lib" \
|
18
|
-
pyenv install \
|
19
|
-
--skip-existing \
|
20
|
-
$(cat .python-version)
|
4
|
+
echo '== Building containers =='
|
5
|
+
docker pull lambci/lambda:build-ruby2.7
|
6
|
+
docker-compose build
|
data/bin/setup
CHANGED
data/bin/test
CHANGED