Skip to content

Commit 37221aa

Browse files
authored
Elastic Beanstalk Changes (#30)
1 parent dae22cb commit 37221aa

8 files changed

Lines changed: 34 additions & 9 deletions

File tree

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
files:
2+
# Runs before `./10_bundle_install.sh`:
3+
"/opt/elasticbeanstalk/hooks/appdeploy/pre/09_gem_install_bundler.sh" :
4+
mode: "000775"
5+
owner: root
6+
group: users
7+
content: |
8+
#!/usr/bin/env bash
9+
10+
EB_APP_STAGING_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k app_staging_dir)
11+
EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir)
12+
# Source the application's Ruby
13+
. $EB_SCRIPT_DIR/use-app-ruby.sh
14+
15+
cd $EB_APP_STAGING_DIR
16+
echo "Installing compatible bundler"
17+
gem install bundler -v 2.0.2

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,8 @@
2424
.byebug_history
2525

2626
# Ignore master key for decrypting credentials and more.
27-
/config/master.key
27+
/config/master.key
28+
# Elastic Beanstalk Files
29+
.elasticbeanstalk/*
30+
!.elasticbeanstalk/*.cfg.yml
31+
!.elasticbeanstalk/*.global.yml

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ gem 'sidekiq'
2525
# gem 'image_processing', '~> 1.2'
2626

2727
# Reduces boot times through caching; required in config/boot.rb
28-
gem 'bootsnap', '>= 1.4.2', require: false
28+
gem 'bootsnap', '>= 1.5.0', require: false
2929

3030
# Use Rack CORS for handling Cross-Origin Resource Sharing (CORS), making cross-origin AJAX possible
3131
# gem 'rack-cors'

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ PLATFORMS
207207

208208
DEPENDENCIES
209209
bcrypt (~> 3.1.7)
210-
bootsnap (>= 1.4.2)
210+
bootsnap (>= 1.5.0)
211211
byebug
212212
jbuilder (~> 2.7)
213213
jwt

app/lib/json_web_token.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# frozen_string_literal: true
22

3-
require_relative './exceptions/jwt_expired_token'
3+
require_relative './JWT/expired_web_token'
44

55
class JsonWebToken
66
SECRET_KEY = Rails.application.secrets.secret_key_base.to_s

app/models/environment_variable.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class EnvironmentVariable < ApplicationRecord
1111
delegate :encrypt_and_sign, :decrypt_and_verify, to: :encryptor
1212

1313
KEY = ActiveSupport::KeyGenerator.new(
14-
Rails.application.secrets.secret_key_base
14+
ENV.fetch('SECRET_KEY_BASE') || Rails.application.secrets.secret_key_base
1515
).generate_key(
1616
ENV.fetch('ENCRYPTION_KEY_SALT'),
1717
ActiveSupport::MessageEncryptor.key_len

config/database.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ test:
8383
# url: <%= ENV['DATABASE_URL'] %>
8484
#
8585
production:
86-
<<: *default
87-
database: bridgeapi_rb_production
88-
username: bridgeapi_rb
89-
password: <%= ENV['BRIDGEAPI_RB_DATABASE_PASSWORD'] %>
86+
adapter: postgresql
87+
encoding: unicode
88+
database: <%= ENV['RDS_DATABASE'] %>
89+
username: <%= ENV['RDS_USERNAME'] %>
90+
password: <%= ENV['RDS_PASSWORD'] %>
91+
host: <%= ENV['RDS_HOST'] %>
92+
port: 5432
93+
pool: 5

0 commit comments

Comments
 (0)