-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gh394] Remove the Figaro gem dependency - Andy changes #411
Changes from all commits
8ceba0f
55abcc4
0be2372
32ff30e
9c49cf2
0bf6dc4
188d969
07b67f5
f220c7d
0d7957e
0359ded
1b7cd10
7e714f5
1d20254
e19a891
e613ea3
ac3f64f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This file is shared with the team and should be used as a template to create `.env.development.local` file | ||
# Clone this file to `.env.development.local` and replace the values with your own | ||
|
||
# Database | ||
DB_NAME=<%= APP_NAME %>_development | ||
DB_POOL=5 | ||
DB_HOST=localhost | ||
DB_PORT=5432 | ||
DB_USERNAME=postgres | ||
DB_PASSWORD=postgres | ||
|
||
# Redis | ||
REDIS_URL=redis://localhost:6379 | ||
|
||
MAILER_DEFAULT_HOST=localhost | ||
MAILER_DEFAULT_PORT=3000 | ||
MAILER_SENDER=Test <[email protected]> | ||
|
||
# Locales | ||
AVAILABLE_LOCALES=en | ||
DEFAULT_LOCALE=en | ||
FALLBACK_LOCALES=en | ||
|
||
# Used to verify the integrity of signed cookies. so ensure a secure value is set | ||
SECRET_KEY_BASE=replace_with_lengthy_secure_hex | ||
|
||
PORT=3000 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,6 @@ | |
/coverage | ||
|
||
# Ignore environment variables files | ||
.env.development | ||
.env.development.local | ||
IGNORE | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
include .env | ||
|
||
.PHONY: dev env/setup env/teardown codebase codebase/fix | ||
|
||
dev: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env ruby | ||
# frozen_string_literal: true | ||
|
||
# For building production docker image | ||
# | ||
# It sets the envs inside the docker image for precompiling the assets | ||
# Because to precompile the assets, Rails initializes the app. | ||
# And it requires the envs as we always use `ENV.fetch` to setup the variables | ||
# | ||
# Related issue: https://github.com/rails/rails/issues/32947 | ||
# TODO: https://github.com/nimblehq/rails-templates/issues/326 | ||
|
||
require 'yaml' | ||
|
||
rails_env = ENV.fetch('RAILS_ENV', 'production') | ||
|
||
if rails_env == 'production' | ||
# Read the contents of the .env file | ||
File.readlines('.env.development.local.example').each do |line| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we build the Docker image, why not using the attribute There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I tried the env_file but not sure why the ENV can't find there...still need time to figure out @olivierobert :D |
||
# Skip empty lines and comments | ||
next if line.strip.empty? || line.start_with?('#') | ||
|
||
# Extract the key and value from each line | ||
key, value = line.split('=', 2).map(&:strip) | ||
|
||
# Set the environment variable | ||
ENV[key] = value | ||
end | ||
|
||
ENV['DATABASE_URL'] = 'postgres://postgres:postgres@postgres:5432/postgres' | ||
end | ||
|
||
exit system('bin/rails i18n:js:export && bin/rails assets:precompile') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
default: &default | ||
adapter: postgresql | ||
encoding: unicode | ||
pool: <%= ENV['DB_POOL'] %> | ||
|
||
development: | ||
<<: *default | ||
host: <%= ENV['DB_HOST'] %> | ||
port: <%= ENV['DB_PORT'] %> | ||
username: <%= ENV['DB_USERNAME'] %> | ||
password: <%= ENV['DB_PASSWORD'] %> | ||
database: <%= ENV['DB_NAME'] %> | ||
|
||
test: | ||
<<: *default | ||
host: <%= ENV['DB_HOST'] %> | ||
port: <%= ENV['DB_PORT'] %> | ||
username: <%= ENV['DB_USERNAME'] %> | ||
password: <%= ENV['DB_PASSWORD'] %> | ||
database: <%= ENV['DB_NAME'] %> | ||
|
||
production: | ||
url: <%= ENV['DATABASE_URL'] %> |
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically, DHH gave a solution that works with a dummy key: rails/rails#32947 (comment)