Skip to content

Commit

Permalink
Don't send real emails in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
zspencer committed Jun 25, 2023
1 parent b191f4e commit d344c03
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .env.development.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
SMTP_PORT=1025
SMTP_DOMAIN=localhost
SMTP_AUTHENTICATION=plain
SMTP_ADDRESS=localhost
SMTP_ENABLE_TLS=false
10 changes: 5 additions & 5 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ FEATURE_INVITATION=true
# PGPASSWORD=password

# Action Mailer Configuration
SMTP_PORT=1025
SMTP_DOMAIN=localhost
SMTP_AUTHENTICATION=plain
SMTP_ADDRESS=localhost
SMTP_ENABLE_TLS=false
# SMTP_PORT=1025
# SMTP_DOMAIN=localhost
# SMTP_AUTHENTICATION=plain
# SMTP_ADDRESS=localhost
# SMTP_ENABLE_TLS=false
# Only set password and username when authentication is being used
# SMTP_PASSWORD=SEE_HEROKU_OR_GENERATE_YOUR_OWN
# SMTP_USERNAME=SEE_HEROKU_OR_GENERATE_YOUR_OWN
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ Finally, with the server still running (perhaps in a different terminal), run
[PostgreSQL 12]: https://www.postgresql.org/download/
[Docker]: https://www.docker.com
[docker-compose.yml]: ./docker-compose.yml
[.env.example]: ./.env.example
[.env.development.example]: ./.env.development.example
[Yarn]: https://yarnpkg.com/getting-started/install

### 2.2. Infrastructure Setup and Documentation.
Expand All @@ -98,7 +98,7 @@ how to configure your local machine or a virtual machine as a video bridge host.

### 2.2.1 Developing Mailers.

Set [SMTP\_\* environment variables to configure Action Mailer](.env.example).
Set [SMTP\_\* environment variables to configure Action Mailer](.env.development.example).

To preview mailers, visit http://localhost:3000/rails/mailers/

Expand Down
7 changes: 7 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,13 @@ else
cp .env.example .env
fi

if test -f ".env.development"; then
echo "Found .env.development, leaving it in place!"
else
echo "Copying .env.development.example to .env.development"
cp .env.development.example .env
fi

# TODO: Figure out how to lock node version, asset building depends on min nodejs version of 12.20.0
# see https://github.com/postcss/postcss-cli/issues/404 for details

Expand Down
4 changes: 4 additions & 0 deletions bin/setup-rails
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ FileUtils.chdir APP_ROOT do
FileUtils.cp '.env.example', '.env'
end

unless File.exist?('.env.development')
FileUtils.cp '.env.development.example', '.env'
end

puts "\n== Preparing development database =="
system! 'bin/rails db:prepare'

Expand Down

0 comments on commit d344c03

Please sign in to comment.