lamby 2.8.0 → 3.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.
Files changed (42) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +11 -0
  3. data/Gemfile.lock +1 -1
  4. data/README.md +1 -5
  5. data/bin/_test +2 -1
  6. data/lib/lamby.rb +1 -0
  7. data/lib/lamby/config.rb +4 -0
  8. data/lib/lamby/handler.rb +23 -8
  9. data/lib/lamby/rack.rb +16 -0
  10. data/lib/lamby/rack_alb.rb +9 -0
  11. data/lib/lamby/rack_http.rb +10 -0
  12. data/lib/lamby/rack_rest.rb +8 -0
  13. data/lib/lamby/runner.rb +58 -0
  14. data/lib/lamby/templates/alb.rb +2 -2
  15. data/lib/lamby/templates/alb/Dockerfile +12 -0
  16. data/lib/lamby/templates/alb/Dockerfile-build +11 -8
  17. data/lib/lamby/templates/alb/_build +9 -24
  18. data/lib/lamby/templates/alb/_deploy +10 -41
  19. data/lib/lamby/templates/alb/app.rb +1 -1
  20. data/lib/lamby/templates/alb/deploy +3 -8
  21. data/lib/lamby/templates/alb/docker-compose.yml +9 -7
  22. data/lib/lamby/templates/alb/template.yaml +1 -1
  23. data/lib/lamby/templates/http.rb +2 -2
  24. data/lib/lamby/templates/http/Dockerfile +12 -0
  25. data/lib/lamby/templates/http/Dockerfile-build +11 -8
  26. data/lib/lamby/templates/http/_build +9 -24
  27. data/lib/lamby/templates/http/_deploy +9 -23
  28. data/lib/lamby/templates/http/app.rb +1 -1
  29. data/lib/lamby/templates/http/deploy +3 -8
  30. data/lib/lamby/templates/http/docker-compose.yml +9 -7
  31. data/lib/lamby/templates/http/template.yaml +1 -1
  32. data/lib/lamby/templates/rest.rb +2 -2
  33. data/lib/lamby/templates/rest/Dockerfile +12 -0
  34. data/lib/lamby/templates/rest/Dockerfile-build +11 -8
  35. data/lib/lamby/templates/rest/_build +9 -24
  36. data/lib/lamby/templates/rest/_deploy +9 -23
  37. data/lib/lamby/templates/rest/app.rb +1 -1
  38. data/lib/lamby/templates/rest/deploy +3 -8
  39. data/lib/lamby/templates/rest/docker-compose.yml +9 -7
  40. data/lib/lamby/templates/rest/template.yaml +1 -1
  41. data/lib/lamby/version.rb +1 -1
  42. metadata +3 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 24518347cf3f2b14390d16a2fff5f0025d3911efd06252721cd49f8fedb90562
4
- data.tar.gz: 3e55836604fc8b6abdf953f2b421f9efdb7689a9ea3fa27cc1528844de06418e
3
+ metadata.gz: 0617227ed78f3d72343201c0c77d89e174c674f22e6a8c42ed6a07b6b1cec866
4
+ data.tar.gz: 8569247f0afb429718263444638a67cef3e765c576217c106e1af9b72025f724
5
5
  SHA512:
6
- metadata.gz: 79bf535b1fc336b634ee33bc5e3a847bd9aaa1c809c6f49c37d6807dc44d26468da1fcf4272599b2d11c1c2d8ed90420301963dbd2723e72060b2067c97b86e1
7
- data.tar.gz: 2ea5e61fe84d7b7b5d9be7001376346dc2574feb68e9a2230e79e781c8365e465f193dc7c89d62cc954d5f37195bae81ebf69376f5d0621b79b8fbbbea76171a
6
+ metadata.gz: 9a2ac758ac583d5547d2112afbb4a78b6fba6261b7f6eb3e9056378a66f71b827528a6986623818e36aa69c680b67478687d1557a8f851111dddc90155d3428b
7
+ data.tar.gz: 287359de5ea4b423f81156e46a5455a739d22b293bb20190c02744a76b0dbd5860b63dfd80177b3aec178be2c8924a81add185a449f43e82c804f79ed17c5702
data/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@
4
4
 
5
5
  See this http://keepachangelog.com link for information on how we want this documented formatted.
6
6
 
7
+ ## v3.0.0
8
+
9
+ #### Added
10
+
11
+ - Automatically handle `Lambdakiq.jobs?(event)`.
12
+ - New event for tasks like DB migrations. #80 #93
13
+
14
+ #### Changed
15
+
16
+ - Updated template files to latest lambda container standards.
17
+
7
18
  ## v2.8.0
8
19
 
9
20
  #### Fixed
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lamby (2.8.0)
4
+ lamby (3.0.0)
5
5
  rack
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,4 +1,3 @@
1
-
2
1
  # Lamby [![Actions Status](https://github.com/customink/lamby/workflows/CI/CD/badge.svg)](https://github.com/customink/lamby/actions)
3
2
 
4
3
  <h2>Simple Rails &amp; AWS Lambda Integration</h2>
@@ -11,7 +10,7 @@ The goal of this project is to provide minimal code to allow your Rails applicat
11
10
 
12
11
  ```ruby
13
12
  def handler(event:, context:)
14
- Lamby.handler $app, event, context, rack: :http
13
+ Lamby.handler $app, event, context
15
14
  end
16
15
  ```
17
16
 
@@ -19,12 +18,10 @@ end
19
18
 
20
19
  https://lamby.custominktech.com/docs/quick_start
21
20
 
22
-
23
21
  ## Full Documentation
24
22
 
25
23
  https://lamby.custominktech.com/docs/installing_aws_sam
26
24
 
27
-
28
25
  ## Contributing
29
26
 
30
27
  After checking out the repo, run:
@@ -37,7 +34,6 @@ $ ./bin/test
37
34
 
38
35
  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.
39
36
 
40
-
41
37
  ## Code of Conduct
42
38
 
43
39
  Everyone interacting in the Lamby project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/customink/lamby/blob/master/CODE_OF_CONDUCT.md).
data/bin/_test CHANGED
@@ -4,4 +4,5 @@ set -e
4
4
  export RAILS_ENV="test"
5
5
 
6
6
  bundle exec rake test
7
- RACK_DEFLATE_ENABLED=1 bundle exec rake test_deflate
7
+ LAMBY_TEST_DYNAMIC_HANDLER=1 bundle exec rake test
8
+ LAMBY_RACK_DEFLATE_ENABLED=1 bundle exec rake test_deflate
data/lib/lamby.rb CHANGED
@@ -9,6 +9,7 @@ require 'lamby/rack_alb'
9
9
  require 'lamby/rack_rest'
10
10
  require 'lamby/rack_http'
11
11
  require 'lamby/debug'
12
+ require 'lamby/runner'
12
13
  require 'lamby/handler'
13
14
 
14
15
  if defined?(Rails)
data/lib/lamby/config.rb CHANGED
@@ -43,5 +43,9 @@ module Lamby
43
43
  @event_bridge_handler = func
44
44
  end
45
45
 
46
+ def runner_patterns
47
+ Runner::PATTERNS
48
+ end
49
+
46
50
  end
47
51
  end
data/lib/lamby/handler.rb CHANGED
@@ -68,16 +68,19 @@ module Lamby
68
68
  private
69
69
 
70
70
  def rack
71
- @rack ||= case @options[:rack]
72
- when :rest, :api
73
- Lamby::RackRest.new @event, @context
74
- when :alb
75
- Lamby::RackAlb.new @event, @context
76
- else
77
- Lamby::RackHttp.new @event, @context
71
+ return @rack if defined?(@rack)
72
+ @rack = begin
73
+ type = rack_option
74
+ klass = Lamby::Rack.lookup type, @event
75
+ (klass && klass.handle?(@event)) ? klass.new(@event, @context) : false
78
76
  end
79
77
  end
80
78
 
79
+ def rack_option
80
+ return if ENV['LAMBY_TEST_DYNAMIC_HANDLER']
81
+ @options[:rack]
82
+ end
83
+
81
84
  def rack_response
82
85
  rack? ? rack.response(self) : {}
83
86
  end
@@ -87,6 +90,10 @@ module Lamby
87
90
  Debug.call @event, @context, rack.env
88
91
  elsif rack?
89
92
  @app.call rack.env
93
+ elsif runner?
94
+ Runner.call(@event)
95
+ elsif lambdakiq?
96
+ Lambdakiq.handler(@event)
90
97
  elsif event_bridge?
91
98
  Lamby.config.event_bridge_handler.call @event, @context
92
99
  [200, {}, StringIO.new('')]
@@ -101,12 +108,20 @@ module Lamby
101
108
  end
102
109
 
103
110
  def rack?
104
- @event.key?('httpMethod') || @event.dig('requestContext', 'http')
111
+ rack
105
112
  end
106
113
 
107
114
  def event_bridge?
108
115
  Lamby.config.event_bridge_handler &&
109
116
  @event.key?('source') && @event.key?('detail') && @event.key?('detail-type')
110
117
  end
118
+
119
+ def lambdakiq?
120
+ defined?(::Lambdakiq) && ::Lambdakiq.job?(@event)
121
+ end
122
+
123
+ def runner?
124
+ Runner.handle?(@event)
125
+ end
111
126
  end
112
127
  end
data/lib/lamby/rack.rb CHANGED
@@ -7,6 +7,22 @@ module Lamby
7
7
  LAMBDA_CONTEXT = 'lambda.context'.freeze
8
8
  HTTP_X_REQUESTID = 'HTTP_X_REQUEST_ID'.freeze
9
9
  HTTP_COOKIE = 'HTTP_COOKIE'.freeze
10
+
11
+ class << self
12
+
13
+ def lookup(type, event)
14
+ types[type] || types.values.detect { |t| t.handle?(event) }
15
+ end
16
+
17
+ # Order is important. REST is hardest to isolated with handle? method.
18
+ def types
19
+ { alb: RackAlb,
20
+ http: RackHttp,
21
+ rest: RackRest,
22
+ api: RackRest }
23
+ end
24
+
25
+ end
10
26
 
11
27
  attr_reader :event, :context
12
28
 
@@ -1,6 +1,15 @@
1
1
  module Lamby
2
2
  class RackAlb < Lamby::Rack
3
3
 
4
+ class << self
5
+
6
+ def handle?(event)
7
+ event.key?('httpMethod') &&
8
+ event.dig('requestContext', 'elb')
9
+ end
10
+
11
+ end
12
+
4
13
  def alb?
5
14
  true
6
15
  end
@@ -1,6 +1,16 @@
1
1
  module Lamby
2
2
  class RackHttp < Lamby::Rack
3
3
 
4
+ class << self
5
+
6
+ def handle?(event)
7
+ event.key?('version') &&
8
+ ( event.dig('requestContext', 'http') ||
9
+ event.dig('requestContext', 'httpMethod') )
10
+ end
11
+
12
+ end
13
+
4
14
  def response(handler)
5
15
  if handler.base64_encodeable?
6
16
  { isBase64Encoded: true, body: handler.body64 }
@@ -1,5 +1,13 @@
1
1
  module Lamby
2
2
  class RackRest < Lamby::Rack
3
+
4
+ class << self
5
+
6
+ def handle?(event)
7
+ event.key?('httpMethod')
8
+ end
9
+
10
+ end
3
11
 
4
12
  def response(handler)
5
13
  if handler.base64_encodeable?
@@ -0,0 +1,58 @@
1
+ require 'open3'
2
+
3
+ module Lamby
4
+ class Runner
5
+ class Error < StandardError ; end
6
+ class UnknownCommandPattern < Error ; end
7
+
8
+ PATTERNS = [
9
+ %r{\A\./bin/(rails|rake) db:migrate.*}
10
+ ]
11
+
12
+ class << self
13
+
14
+ def handle?(event)
15
+ event.dig 'lamby', 'runner'
16
+ end
17
+
18
+ def call(event)
19
+ new(event).call
20
+ end
21
+
22
+ end
23
+
24
+ def initialize(event)
25
+ @event = event
26
+ end
27
+
28
+ def call
29
+ validate!
30
+ status = Open3.popen3(command, chdir: chdir) do |_stdin, stdout, stderr, thread|
31
+ puts stdout.read
32
+ puts stderr.read
33
+ thread.value.exitstatus
34
+ end
35
+ [status, {}, StringIO.new('')]
36
+ end
37
+
38
+ def command
39
+ @event.dig 'lamby', 'runner'
40
+ end
41
+
42
+ private
43
+
44
+ def chdir
45
+ defined?(::Rails) ? ::Rails.root : Dir.pwd
46
+ end
47
+
48
+ def validate!
49
+ return if pattern?
50
+ raise UnknownCommandPattern.new(command)
51
+ end
52
+
53
+ def pattern?
54
+ PATTERNS.any? { |p| p === command }
55
+ end
56
+
57
+ end
58
+ end
@@ -10,13 +10,13 @@ gsub_file app_file('template.yaml'), /APPNAMEHERE/, appname
10
10
  copy_file tpl_file('Dockerfile'), app_file('Dockerfile')
11
11
  copy_file tpl_file('Dockerfile-build'), app_file('Dockerfile-build')
12
12
  copy_file tpl_file('docker-compose.yml'), app_file('docker-compose.yml')
13
+ gsub_file app_file('docker-compose.yml'), /APPNAMEHERE/, appname.downcase
13
14
 
14
15
  say 'Adding to .gitignore...'
15
16
  FileUtils.touch app_file('.gitignore')
16
17
  append_to_file app_file('.gitignore'), <<~GITIGNORE
17
18
  # Lamby
18
19
  /.aws-sam
19
- /.lamby
20
20
  GITIGNORE
21
21
 
22
22
  say 'Creating ./bin files for build and deploy...'
@@ -24,10 +24,10 @@ copy_file tpl_file('_build'), app_file('bin/_build')
24
24
  gsub_file app_file('bin/_build'), /APPNAMEHERE/, appname.downcase
25
25
  chmod app_file('bin/_build'), 0755
26
26
  copy_file tpl_file('deploy'), app_file('bin/deploy')
27
+ gsub_file app_file('bin/deploy'), /APPNAMEHERE/, appname.downcase
27
28
  chmod app_file('bin/deploy'), 0755
28
29
  copy_file tpl_file('_deploy'), app_file('bin/_deploy')
29
30
  gsub_file app_file('bin/_deploy'), /APPNAMEHERE/, appname.downcase
30
31
  chmod app_file('bin/_deploy'), 0755
31
- gsub_file app_file('bin/deploy'), /APPNAMEHERE/, appname.downcase
32
32
 
33
33
  say 'Welcome to AWS Lambda and Rails 🎉', :green
@@ -1,3 +1,15 @@
1
1
  FROM public.ecr.aws/lambda/ruby:2.7
2
+ ARG RAILS_ENV
3
+ ENV RAILS_ENV=$RAILS_ENV
4
+
2
5
  COPY . .
6
+
7
+ # == Cleanup Unused Files & Directories ==
8
+ RUN rm -rf \
9
+ log \
10
+ node_modules \
11
+ test \
12
+ tmp \
13
+ vendor/bundle/ruby/2.7.0/cache
14
+
3
15
  CMD ["app.handler"]
@@ -1,15 +1,18 @@
1
1
  FROM amazon/aws-sam-cli-build-image-ruby2.7
2
2
 
3
3
  # Ensure minimum required SAM version.
4
- # RUN pip install awscli && \
5
- # pip uninstall --yes aws-sam-cli && \
6
- # pip install aws-sam-cli==v1.13.2
4
+ ENV SAM_CLI_VERSION=1.23.0
5
+ RUN curl -L "https://github.com/aws/aws-sam-cli/releases/download/v${SAM_CLI_VERSION}/aws-sam-cli-linux-x86_64.zip" \
6
+ -o "aws-sam-cli-linux-x86_64.zip" && \
7
+ unzip -q aws-sam-cli-linux-x86_64.zip -d sam-installation && \
8
+ ./sam-installation/install && \
9
+ rm -rf ./sam-installation ./aws-sam-cli-linux-x86_64.zip
7
10
 
8
11
  # Node for JavaScript.
9
- # RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash - && \
10
- # yum install -y nodejs && \
11
- # curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
12
- # rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg && \
13
- # yum install -y yarn
12
+ RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - && \
13
+ yum install -y nodejs && \
14
+ curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
15
+ rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg && \
16
+ yum install -y yarn
14
17
 
15
18
  WORKDIR /var/task
@@ -1,20 +1,15 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
  set -e
3
3
 
4
- echo '== Simulate SAM Build Directory =='
5
- RESOURCE="RailsLambda"
6
- SAM_TEMP=$(mktemp -d -t sam.XXXXXX)
7
- rm -rf ./.lamby ./.aws-sam
8
- cp -r . "$SAM_TEMP"
9
- mkdir -p ./.lamby
10
- cp -r "$SAM_TEMP" "./.lamby/$RESOURCE"
11
- pushd "./.lamby/$RESOURCE"
12
-
13
- echo '== Cleaning Dev Dependencies =='
14
- rm -rf ./.bundle \
15
- ./vendor/bundle
4
+ if [ "$CI" != "true" ]; then
5
+ echo "== Cleaning dev dependencies for local deploy. Run ./bin/setup again afterward! =="
6
+ rm -rf ./.bundle \
7
+ ./vendor/bundle \
8
+ ./node_modules
9
+ fi
16
10
 
17
11
  echo '== Bundle For Deployment =='
12
+ bundle lock --add-platform x86_64-linux
18
13
  bundle config --local deployment true
19
14
  bundle config --local without 'development test'
20
15
  bundle config --local path './vendor/bundle'
@@ -27,14 +22,4 @@ echo "== Environments & Configuration =="
27
22
  # LAMBY_SSM_PARAMS_PATH="/APPNAMEHERE/${RAILS_ENV}/env"
28
23
 
29
24
  echo "== Asset Hosts & Precompiling =="
30
- # NODE_ENV='production' \
31
- # RAILS_GROUPS=assets \
32
- # ./bin/rails assets:precompile
33
-
34
- echo "== Cleanup Unused Files & Directories =="
35
- rm -rf \
36
- log \
37
- node_modules \
38
- test \
39
- tmp \
40
- vendor/bundle/ruby/2.7.0/cache
25
+ NODE_ENV='production' ./bin/rails assets:precompile
@@ -1,62 +1,31 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
  set -e
3
3
 
4
- export DEPLOYMENT_NAME="myorg/APPNAMEHERE"
5
- export RAILS_ENV=${RAILS_ENV:="production"}
6
- export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:=us-east-1}
7
- export CLOUDFORMATION_BUCKET=${CLOUDFORMATION_BUCKET:="lamby.cloudformation.${DEPLOYMENT_NAME/\//-}"}
8
-
9
4
  # https://github.com/aws/aws-sam-cli/issues/2447
10
- export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
11
- export IMAGE_REPOSITORY="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${DEPLOYMENT_NAME}"
12
-
13
- echo '== Creating ECR repository =='
14
- echo 'You can safely ignore any RepositoryAlreadyExistsException errors...'
15
- aws ecr create-repository \
16
- --repository-name "$DEPLOYMENT_NAME" \
17
- --image-tag-mutability MUTABLE \
18
- --image-scanning-configuration scanOnPush=true \
19
- --region "$AWS_DEFAULT_REGION" || true
5
+ AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
6
+ IMAGE_REPOSITORY="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/APPNAMEHERE"
20
7
 
21
- # Build our application code into a deployment folder
8
+ echo "== Lamby build =="
22
9
  ./bin/_build
23
10
 
24
- export VPCID=${VPCID:=$(
25
- aws ec2 describe-vpcs \
26
- --output text \
27
- --filters 'Name=state,Values=available' \
28
- --query 'Vpcs[0].VpcId'
29
- )}
30
-
31
- export SUBNETS=${SUBNETS:=$(
32
- aws ec2 describe-subnets \
33
- --output text \
34
- --filters 'Name=state,Values=available' "Name=vpc-id,Values=$VPCID" \
35
- --query 'Subnets[*].SubnetId' | \
36
- tr -s '[:blank:]' ','
37
- )}
38
-
11
+ echo "== SAM build =="
39
12
  sam build \
40
13
  --parameter-overrides \
41
- RailsEnv="${RAILS_ENV}"
14
+ RailsEnv="${RAILS_ENV}"
42
15
 
43
- echo "== SAM package..."
16
+ echo "== SAM package =="
44
17
  sam package \
45
18
  --region "$AWS_DEFAULT_REGION" \
46
19
  --template-file ./.aws-sam/build/template.yaml \
47
20
  --output-template-file ./.aws-sam/build/packaged.yaml \
48
21
  --image-repository "$IMAGE_REPOSITORY" \
49
- --s3-bucket "${CLOUDFORMATION_BUCKET}" \
50
- --s3-prefix "${DEPLOYMENT_NAME/\//-}-${RAILS_ENV}"
51
22
 
52
- echo "== SAM deploy..."
23
+ echo "== SAM deploy =="
53
24
  sam deploy \
54
25
  --region "$AWS_DEFAULT_REGION" \
55
26
  --template-file ./.aws-sam/build/packaged.yaml \
56
- --stack-name "${DEPLOYMENT_NAME/\//-}-${RAILS_ENV}" \
27
+ --stack-name "APPNAMEHERE-${RAILS_ENV}" \
57
28
  --image-repository "$IMAGE_REPOSITORY" \
58
29
  --capabilities "CAPABILITY_IAM" \
59
30
  --parameter-overrides \
60
- RailsEnv="${RAILS_ENV}" \
61
- VpcId=${VPCID} \
62
- Subnets=${SUBNETS}
31
+ RailsEnv="${RAILS_ENV}"
@@ -8,5 +8,5 @@ require_relative 'config/environment'
8
8
  $app = Rack::Builder.new { run Rails.application }.to_app
9
9
 
10
10
  def handler(event:, context:)
11
- Lamby.handler $app, event, context, rack: :alb
11
+ Lamby.handler $app, event, context
12
12
  end
@@ -1,13 +1,8 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
  set -e
3
3
 
4
4
  export RAILS_ENV=${RAILS_ENV:=production}
5
5
 
6
- if [[ "$OSTYPE" == *"darwin"* ]]; then
7
- export SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
8
- fi
9
-
10
6
  docker-compose run \
11
- -e CLOUDFORMATION_BUCKET \
12
- cicd \
13
- ./bin/_deploy
7
+ APPNAMEHERE \
8
+ ./bin/_deploy
@@ -1,17 +1,19 @@
1
1
  version: '3.7'
2
2
  services:
3
- cicd:
3
+ APPNAMEHERE:
4
4
  build:
5
- context: .
5
+ context: '.'
6
6
  dockerfile: Dockerfile-build
7
+ entrypoint: ./bin/entrypoint
7
8
  environment:
8
9
  - RAILS_ENV=${RAILS_ENV-development}
10
+ - SAM_CLI_TELEMETRY=0
9
11
  - AWS_PROFILE=${AWS_PROFILE-default}
12
+ - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
13
+ - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
10
14
  - AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION-us-east-1}
11
- - SSH_AUTH_SOCK=${SSH_AUTH_SOCK}
15
+ - CI=${CI}
12
16
  volumes:
13
- - ${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK}
14
- - ~/.aws:/root/.aws:delegated
15
- - ~/.ssh/known_hosts:/root/.ssh/known_hosts
16
- - .:/var/task:delegated
17
+ - ${PWD}:/var/task
18
+ - ${HOME}/.aws:/root/.aws
17
19
  - /var/run/docker.sock:/var/run/docker.sock
@@ -68,7 +68,7 @@ Resources:
68
68
  RailsLambda:
69
69
  Type: AWS::Serverless::Function
70
70
  Metadata:
71
- DockerContext: ./.lamby/RailsLambda
71
+ DockerContext: .
72
72
  Dockerfile: Dockerfile
73
73
  Properties:
74
74
  MemorySize: 512
@@ -10,13 +10,13 @@ gsub_file app_file('template.yaml'), /APPNAMEHERE/, appname
10
10
  copy_file tpl_file('Dockerfile'), app_file('Dockerfile')
11
11
  copy_file tpl_file('Dockerfile-build'), app_file('Dockerfile-build')
12
12
  copy_file tpl_file('docker-compose.yml'), app_file('docker-compose.yml')
13
+ gsub_file app_file('docker-compose.yml'), /APPNAMEHERE/, appname.downcase
13
14
 
14
15
  say 'Adding to .gitignore...'
15
16
  FileUtils.touch app_file('.gitignore')
16
17
  append_to_file app_file('.gitignore'), <<~GITIGNORE
17
18
  # Lamby
18
19
  /.aws-sam
19
- /.lamby
20
20
  GITIGNORE
21
21
 
22
22
  say 'Creating ./bin files for build and deploy...'
@@ -24,10 +24,10 @@ copy_file tpl_file('_build'), app_file('bin/_build')
24
24
  gsub_file app_file('bin/_build'), /APPNAMEHERE/, appname.downcase
25
25
  chmod app_file('bin/_build'), 0755
26
26
  copy_file tpl_file('deploy'), app_file('bin/deploy')
27
+ gsub_file app_file('bin/deploy'), /APPNAMEHERE/, appname.downcase
27
28
  chmod app_file('bin/deploy'), 0755
28
29
  copy_file tpl_file('_deploy'), app_file('bin/_deploy')
29
30
  gsub_file app_file('bin/_deploy'), /APPNAMEHERE/, appname.downcase
30
31
  chmod app_file('bin/_deploy'), 0755
31
- gsub_file app_file('bin/deploy'), /APPNAMEHERE/, appname.downcase
32
32
 
33
33
  say 'Welcome to AWS Lambda and Rails 🎉', :green
@@ -1,3 +1,15 @@
1
1
  FROM public.ecr.aws/lambda/ruby:2.7
2
+ ARG RAILS_ENV
3
+ ENV RAILS_ENV=$RAILS_ENV
4
+
2
5
  COPY . .
6
+
7
+ # == Cleanup Unused Files & Directories ==
8
+ RUN rm -rf \
9
+ log \
10
+ node_modules \
11
+ test \
12
+ tmp \
13
+ vendor/bundle/ruby/2.7.0/cache
14
+
3
15
  CMD ["app.handler"]
@@ -1,15 +1,18 @@
1
1
  FROM amazon/aws-sam-cli-build-image-ruby2.7
2
2
 
3
3
  # Ensure minimum required SAM version.
4
- # RUN pip install awscli && \
5
- # pip uninstall --yes aws-sam-cli && \
6
- # pip install aws-sam-cli==v1.13.2
4
+ ENV SAM_CLI_VERSION=1.23.0
5
+ RUN curl -L "https://github.com/aws/aws-sam-cli/releases/download/v${SAM_CLI_VERSION}/aws-sam-cli-linux-x86_64.zip" \
6
+ -o "aws-sam-cli-linux-x86_64.zip" && \
7
+ unzip -q aws-sam-cli-linux-x86_64.zip -d sam-installation && \
8
+ ./sam-installation/install && \
9
+ rm -rf ./sam-installation ./aws-sam-cli-linux-x86_64.zip
7
10
 
8
11
  # Node for JavaScript.
9
- # RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash - && \
10
- # yum install -y nodejs && \
11
- # curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
12
- # rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg && \
13
- # yum install -y yarn
12
+ RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - && \
13
+ yum install -y nodejs && \
14
+ curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
15
+ rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg && \
16
+ yum install -y yarn
14
17
 
15
18
  WORKDIR /var/task
@@ -1,20 +1,15 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
  set -e
3
3
 
4
- echo '== Simulate SAM Build Directory =='
5
- RESOURCE="RailsLambda"
6
- SAM_TEMP=$(mktemp -d -t sam.XXXXXX)
7
- rm -rf ./.lamby ./.aws-sam
8
- cp -r . "$SAM_TEMP"
9
- mkdir -p ./.lamby
10
- cp -r "$SAM_TEMP" "./.lamby/$RESOURCE"
11
- pushd "./.lamby/$RESOURCE"
12
-
13
- echo '== Cleaning Dev Dependencies =='
14
- rm -rf ./.bundle \
15
- ./vendor/bundle
4
+ if [ "$CI" != "true" ]; then
5
+ echo "== Cleaning dev dependencies for local deploy. Run ./bin/setup again afterward! =="
6
+ rm -rf ./.bundle \
7
+ ./vendor/bundle \
8
+ ./node_modules
9
+ fi
16
10
 
17
11
  echo '== Bundle For Deployment =='
12
+ bundle lock --add-platform x86_64-linux
18
13
  bundle config --local deployment true
19
14
  bundle config --local without 'development test'
20
15
  bundle config --local path './vendor/bundle'
@@ -27,14 +22,4 @@ echo "== Environments & Configuration =="
27
22
  # LAMBY_SSM_PARAMS_PATH="/APPNAMEHERE/${RAILS_ENV}/env"
28
23
 
29
24
  echo "== Asset Hosts & Precompiling =="
30
- # NODE_ENV='production' \
31
- # RAILS_GROUPS=assets \
32
- # ./bin/rails assets:precompile
33
-
34
- echo "== Cleanup Unused Files & Directories =="
35
- rm -rf \
36
- log \
37
- node_modules \
38
- test \
39
- tmp \
40
- vendor/bundle/ruby/2.7.0/cache
25
+ NODE_ENV='production' ./bin/rails assets:precompile
@@ -1,44 +1,30 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
  set -e
3
3
 
4
- export DEPLOYMENT_NAME="myorg/APPNAMEHERE"
5
- export RAILS_ENV=${RAILS_ENV:="production"}
6
- export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:=us-east-1}
7
- export CLOUDFORMATION_BUCKET=${CLOUDFORMATION_BUCKET:="lamby.cloudformation.${DEPLOYMENT_NAME/\//-}"}
8
-
9
4
  # https://github.com/aws/aws-sam-cli/issues/2447
10
- export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
11
- export IMAGE_REPOSITORY="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${DEPLOYMENT_NAME}"
12
-
13
- echo '== Creating ECR repository =='
14
- echo 'You can safely ignore any RepositoryAlreadyExistsException errors...'
15
- aws ecr create-repository \
16
- --repository-name "$DEPLOYMENT_NAME" \
17
- --image-tag-mutability MUTABLE \
18
- --image-scanning-configuration scanOnPush=true \
19
- --region "$AWS_DEFAULT_REGION" || true
5
+ AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
6
+ IMAGE_REPOSITORY="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/APPNAMEHERE"
20
7
 
21
- # Build our application code into a deployment folder
8
+ echo "== Lamby build =="
22
9
  ./bin/_build
23
10
 
11
+ echo "== SAM build =="
24
12
  sam build \
25
13
  --parameter-overrides \
26
- RailsEnv="${RAILS_ENV}"
14
+ RailsEnv="${RAILS_ENV}"
27
15
 
28
- echo "== SAM package..."
16
+ echo "== SAM package =="
29
17
  sam package \
30
18
  --region "$AWS_DEFAULT_REGION" \
31
19
  --template-file ./.aws-sam/build/template.yaml \
32
20
  --output-template-file ./.aws-sam/build/packaged.yaml \
33
21
  --image-repository "$IMAGE_REPOSITORY" \
34
- --s3-bucket "${CLOUDFORMATION_BUCKET}" \
35
- --s3-prefix "${DEPLOYMENT_NAME/\//-}-${RAILS_ENV}"
36
22
 
37
- echo "== SAM deploy..."
23
+ echo "== SAM deploy =="
38
24
  sam deploy \
39
25
  --region "$AWS_DEFAULT_REGION" \
40
26
  --template-file ./.aws-sam/build/packaged.yaml \
41
- --stack-name "${DEPLOYMENT_NAME/\//-}-${RAILS_ENV}" \
27
+ --stack-name "APPNAMEHERE-${RAILS_ENV}" \
42
28
  --image-repository "$IMAGE_REPOSITORY" \
43
29
  --capabilities "CAPABILITY_IAM" \
44
30
  --parameter-overrides \
@@ -8,5 +8,5 @@ require_relative 'config/environment'
8
8
  $app = Rack::Builder.new { run Rails.application }.to_app
9
9
 
10
10
  def handler(event:, context:)
11
- Lamby.handler $app, event, context, rack: :http
11
+ Lamby.handler $app, event, context
12
12
  end
@@ -1,13 +1,8 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
  set -e
3
3
 
4
4
  export RAILS_ENV=${RAILS_ENV:=production}
5
5
 
6
- if [[ "$OSTYPE" == *"darwin"* ]]; then
7
- export SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
8
- fi
9
-
10
6
  docker-compose run \
11
- -e CLOUDFORMATION_BUCKET \
12
- cicd \
13
- ./bin/_deploy
7
+ APPNAMEHERE \
8
+ ./bin/_deploy
@@ -1,17 +1,19 @@
1
1
  version: '3.7'
2
2
  services:
3
- cicd:
3
+ APPNAMEHERE:
4
4
  build:
5
- context: .
5
+ context: '.'
6
6
  dockerfile: Dockerfile-build
7
+ entrypoint: ./bin/entrypoint
7
8
  environment:
8
9
  - RAILS_ENV=${RAILS_ENV-development}
10
+ - SAM_CLI_TELEMETRY=0
9
11
  - AWS_PROFILE=${AWS_PROFILE-default}
12
+ - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
13
+ - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
10
14
  - AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION-us-east-1}
11
- - SSH_AUTH_SOCK=${SSH_AUTH_SOCK}
15
+ - CI=${CI}
12
16
  volumes:
13
- - ${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK}
14
- - ~/.aws:/root/.aws:delegated
15
- - ~/.ssh/known_hosts:/root/.ssh/known_hosts
16
- - .:/var/task:delegated
17
+ - ${PWD}:/var/task
18
+ - ${HOME}/.aws:/root/.aws
17
19
  - /var/run/docker.sock:/var/run/docker.sock
@@ -16,7 +16,7 @@ Resources:
16
16
  RailsLambda:
17
17
  Type: AWS::Serverless::Function
18
18
  Metadata:
19
- DockerContext: ./.lamby/RailsLambda
19
+ DockerContext: .
20
20
  Dockerfile: Dockerfile
21
21
  Properties:
22
22
  MemorySize: 512
@@ -10,13 +10,13 @@ gsub_file app_file('template.yaml'), /APPNAMEHERE/, appname
10
10
  copy_file tpl_file('Dockerfile'), app_file('Dockerfile')
11
11
  copy_file tpl_file('Dockerfile-build'), app_file('Dockerfile-build')
12
12
  copy_file tpl_file('docker-compose.yml'), app_file('docker-compose.yml')
13
+ gsub_file app_file('docker-compose.yml'), /APPNAMEHERE/, appname.downcase
13
14
 
14
15
  say 'Adding to .gitignore...'
15
16
  FileUtils.touch app_file('.gitignore')
16
17
  append_to_file app_file('.gitignore'), <<~GITIGNORE
17
18
  # Lamby
18
19
  /.aws-sam
19
- /.lamby
20
20
  GITIGNORE
21
21
 
22
22
  say 'Creating ./bin files for build and deploy...'
@@ -24,10 +24,10 @@ copy_file tpl_file('_build'), app_file('bin/_build')
24
24
  gsub_file app_file('bin/_build'), /APPNAMEHERE/, appname.downcase
25
25
  chmod app_file('bin/_build'), 0755
26
26
  copy_file tpl_file('deploy'), app_file('bin/deploy')
27
+ gsub_file app_file('bin/deploy'), /APPNAMEHERE/, appname.downcase
27
28
  chmod app_file('bin/deploy'), 0755
28
29
  copy_file tpl_file('_deploy'), app_file('bin/_deploy')
29
30
  gsub_file app_file('bin/_deploy'), /APPNAMEHERE/, appname.downcase
30
31
  chmod app_file('bin/_deploy'), 0755
31
- gsub_file app_file('bin/deploy'), /APPNAMEHERE/, appname.downcase
32
32
 
33
33
  say 'Welcome to AWS Lambda and Rails 🎉', :green
@@ -1,3 +1,15 @@
1
1
  FROM public.ecr.aws/lambda/ruby:2.7
2
+ ARG RAILS_ENV
3
+ ENV RAILS_ENV=$RAILS_ENV
4
+
2
5
  COPY . .
6
+
7
+ # == Cleanup Unused Files & Directories ==
8
+ RUN rm -rf \
9
+ log \
10
+ node_modules \
11
+ test \
12
+ tmp \
13
+ vendor/bundle/ruby/2.7.0/cache
14
+
3
15
  CMD ["app.handler"]
@@ -1,15 +1,18 @@
1
1
  FROM amazon/aws-sam-cli-build-image-ruby2.7
2
2
 
3
3
  # Ensure minimum required SAM version.
4
- # RUN pip install awscli && \
5
- # pip uninstall --yes aws-sam-cli && \
6
- # pip install aws-sam-cli==v1.13.2
4
+ ENV SAM_CLI_VERSION=1.23.0
5
+ RUN curl -L "https://github.com/aws/aws-sam-cli/releases/download/v${SAM_CLI_VERSION}/aws-sam-cli-linux-x86_64.zip" \
6
+ -o "aws-sam-cli-linux-x86_64.zip" && \
7
+ unzip -q aws-sam-cli-linux-x86_64.zip -d sam-installation && \
8
+ ./sam-installation/install && \
9
+ rm -rf ./sam-installation ./aws-sam-cli-linux-x86_64.zip
7
10
 
8
11
  # Node for JavaScript.
9
- # RUN curl -sL https://rpm.nodesource.com/setup_12.x | bash - && \
10
- # yum install -y nodejs && \
11
- # curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
12
- # rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg && \
13
- # yum install -y yarn
12
+ RUN curl -sL https://rpm.nodesource.com/setup_14.x | bash - && \
13
+ yum install -y nodejs && \
14
+ curl --silent --location https://dl.yarnpkg.com/rpm/yarn.repo | tee /etc/yum.repos.d/yarn.repo && \
15
+ rpm --import https://dl.yarnpkg.com/rpm/pubkey.gpg && \
16
+ yum install -y yarn
14
17
 
15
18
  WORKDIR /var/task
@@ -1,20 +1,15 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
  set -e
3
3
 
4
- echo '== Simulate SAM Build Directory =='
5
- RESOURCE="RailsLambda"
6
- SAM_TEMP=$(mktemp -d -t sam.XXXXXX)
7
- rm -rf ./.lamby ./.aws-sam
8
- cp -r . "$SAM_TEMP"
9
- mkdir -p ./.lamby
10
- cp -r "$SAM_TEMP" "./.lamby/$RESOURCE"
11
- pushd "./.lamby/$RESOURCE"
12
-
13
- echo '== Cleaning Dev Dependencies =='
14
- rm -rf ./.bundle \
15
- ./vendor/bundle
4
+ if [ "$CI" != "true" ]; then
5
+ echo "== Cleaning dev dependencies for local deploy. Run ./bin/setup again afterward! =="
6
+ rm -rf ./.bundle \
7
+ ./vendor/bundle \
8
+ ./node_modules
9
+ fi
16
10
 
17
11
  echo '== Bundle For Deployment =='
12
+ bundle lock --add-platform x86_64-linux
18
13
  bundle config --local deployment true
19
14
  bundle config --local without 'development test'
20
15
  bundle config --local path './vendor/bundle'
@@ -27,14 +22,4 @@ echo "== Environments & Configuration =="
27
22
  # LAMBY_SSM_PARAMS_PATH="/APPNAMEHERE/${RAILS_ENV}/env"
28
23
 
29
24
  echo "== Asset Hosts & Precompiling =="
30
- # NODE_ENV='production' \
31
- # RAILS_GROUPS=assets \
32
- # ./bin/rails assets:precompile
33
-
34
- echo "== Cleanup Unused Files & Directories =="
35
- rm -rf \
36
- log \
37
- node_modules \
38
- test \
39
- tmp \
40
- vendor/bundle/ruby/2.7.0/cache
25
+ NODE_ENV='production' ./bin/rails assets:precompile
@@ -1,44 +1,30 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
  set -e
3
3
 
4
- export DEPLOYMENT_NAME="myorg/APPNAMEHERE"
5
- export RAILS_ENV=${RAILS_ENV:="production"}
6
- export AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION:=us-east-1}
7
- export CLOUDFORMATION_BUCKET=${CLOUDFORMATION_BUCKET:="lamby.cloudformation.${DEPLOYMENT_NAME/\//-}"}
8
-
9
4
  # https://github.com/aws/aws-sam-cli/issues/2447
10
- export AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
11
- export IMAGE_REPOSITORY="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/${DEPLOYMENT_NAME}"
12
-
13
- echo '== Creating ECR repository =='
14
- echo 'You can safely ignore any RepositoryAlreadyExistsException errors...'
15
- aws ecr create-repository \
16
- --repository-name "$DEPLOYMENT_NAME" \
17
- --image-tag-mutability MUTABLE \
18
- --image-scanning-configuration scanOnPush=true \
19
- --region "$AWS_DEFAULT_REGION" || true
5
+ AWS_ACCOUNT_ID=$(aws sts get-caller-identity --query Account --output text)
6
+ IMAGE_REPOSITORY="${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_DEFAULT_REGION}.amazonaws.com/APPNAMEHERE"
20
7
 
21
- # Build our application code into a deployment folder
8
+ echo "== Lamby build =="
22
9
  ./bin/_build
23
10
 
11
+ echo "== SAM build =="
24
12
  sam build \
25
13
  --parameter-overrides \
26
- RailsEnv="${RAILS_ENV}"
14
+ RailsEnv="${RAILS_ENV}"
27
15
 
28
- echo "== SAM package..."
16
+ echo "== SAM package =="
29
17
  sam package \
30
18
  --region "$AWS_DEFAULT_REGION" \
31
19
  --template-file ./.aws-sam/build/template.yaml \
32
20
  --output-template-file ./.aws-sam/build/packaged.yaml \
33
21
  --image-repository "$IMAGE_REPOSITORY" \
34
- --s3-bucket "${CLOUDFORMATION_BUCKET}" \
35
- --s3-prefix "${DEPLOYMENT_NAME/\//-}-${RAILS_ENV}"
36
22
 
37
- echo "== SAM deploy..."
23
+ echo "== SAM deploy =="
38
24
  sam deploy \
39
25
  --region "$AWS_DEFAULT_REGION" \
40
26
  --template-file ./.aws-sam/build/packaged.yaml \
41
- --stack-name "${DEPLOYMENT_NAME/\//-}-${RAILS_ENV}" \
27
+ --stack-name "APPNAMEHERE-${RAILS_ENV}" \
42
28
  --image-repository "$IMAGE_REPOSITORY" \
43
29
  --capabilities "CAPABILITY_IAM" \
44
30
  --parameter-overrides \
@@ -8,5 +8,5 @@ require_relative 'config/environment'
8
8
  $app = Rack::Builder.new { run Rails.application }.to_app
9
9
 
10
10
  def handler(event:, context:)
11
- Lamby.handler $app, event, context, rack: :rest
11
+ Lamby.handler $app, event, context
12
12
  end
@@ -1,13 +1,8 @@
1
- #!/usr/bin/env bash
1
+ #!/bin/sh
2
2
  set -e
3
3
 
4
4
  export RAILS_ENV=${RAILS_ENV:=production}
5
5
 
6
- if [[ "$OSTYPE" == *"darwin"* ]]; then
7
- export SSH_AUTH_SOCK=/run/host-services/ssh-auth.sock
8
- fi
9
-
10
6
  docker-compose run \
11
- -e CLOUDFORMATION_BUCKET \
12
- cicd \
13
- ./bin/_deploy
7
+ APPNAMEHERE \
8
+ ./bin/_deploy
@@ -1,17 +1,19 @@
1
1
  version: '3.7'
2
2
  services:
3
- cicd:
3
+ APPNAMEHERE:
4
4
  build:
5
- context: .
5
+ context: '.'
6
6
  dockerfile: Dockerfile-build
7
+ entrypoint: ./bin/entrypoint
7
8
  environment:
8
9
  - RAILS_ENV=${RAILS_ENV-development}
10
+ - SAM_CLI_TELEMETRY=0
9
11
  - AWS_PROFILE=${AWS_PROFILE-default}
12
+ - AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
13
+ - AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
10
14
  - AWS_DEFAULT_REGION=${AWS_DEFAULT_REGION-us-east-1}
11
- - SSH_AUTH_SOCK=${SSH_AUTH_SOCK}
15
+ - CI=${CI}
12
16
  volumes:
13
- - ${SSH_AUTH_SOCK}:${SSH_AUTH_SOCK}
14
- - ~/.aws:/root/.aws:delegated
15
- - ~/.ssh/known_hosts:/root/.ssh/known_hosts
16
- - .:/var/task:delegated
17
+ - ${PWD}:/var/task
18
+ - ${HOME}/.aws:/root/.aws
17
19
  - /var/run/docker.sock:/var/run/docker.sock
@@ -49,7 +49,7 @@ Resources:
49
49
  RailsLambda:
50
50
  Type: AWS::Serverless::Function
51
51
  Metadata:
52
- DockerContext: ./.lamby/RailsLambda
52
+ DockerContext: .
53
53
  Dockerfile: Dockerfile
54
54
  Properties:
55
55
  MemorySize: 512
data/lib/lamby/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Lamby
2
- VERSION = '2.8.0'
2
+ VERSION = '3.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lamby
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.0
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken Collins
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-05-08 00:00:00.000000000 Z
11
+ date: 2021-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -159,6 +159,7 @@ files:
159
159
  - lib/lamby/rack_http.rb
160
160
  - lib/lamby/rack_rest.rb
161
161
  - lib/lamby/railtie.rb
162
+ - lib/lamby/runner.rb
162
163
  - lib/lamby/sam_helpers.rb
163
164
  - lib/lamby/ssm_parameter_store.rb
164
165
  - lib/lamby/tasks.rake