Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed Nov 27, 2024
1 parent ef9f4fe commit d86dceb
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Ignore all environment files.
/.env*
!/.env*.erb
!/.env*.example
!/.env*.sample

# Ignore all default key files.
/config/master.key
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:

test:
runs-on: ubuntu-latest
env:
DATABASE_URL: postgres://postgres:postgres@localhost:5432
# REDIS_URL: redis://localhost:6379/0

services:
postgres:
Expand Down Expand Up @@ -69,11 +72,12 @@ jobs:
ruby-version: .ruby-version
bundler-cache: true

- name: Set up configs
run: bin/setup --skip-server

- name: Run tests
env:
RAILS_ENV: test
DATABASE_URL: postgres://postgres:postgres@localhost:5432
# REDIS_URL: redis://localhost:6379/0
run: bin/rails db:test:prepare test test:system

- name: Keep screenshots from failed system tests
Expand Down
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# Ignore all environment files.
/.env*
!/.env*.erb
!/.env*.example
!/.env*.sample

# Ignore all logfiles and tempfiles.
/log/*
Expand All @@ -38,7 +38,7 @@
/config/credentials/*.yml.enc

# Ignore all config files
/config/cable.yml
/config/database.yml
/config/solid_cache.yml
/config/solid_queue.yml
/config/cable.yml
/config/cache.yml
/config/queue.yml
22 changes: 18 additions & 4 deletions bin/setup
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,24 @@ FileUtils.chdir APP_ROOT do
puts "== Installing dependencies =="
system("bundle check") || system!("bundle install")

# puts "\n== Copying sample files =="
# unless File.exist?("config/database.yml")
# FileUtils.cp "config/database.yml.sample", "config/database.yml"
# end
puts "\n== Copying sample files =="
unless File.exist?("config/database.yml")
FileUtils.cp "config/database.yml.sample", "config/database.yml"
end
unless File.exist?("config/cable.yml")
FileUtils.cp "config/cable.yml.sample", "config/cable.yml"
end
unless File.exist?("config/cache.yml")
FileUtils.cp "config/cache.yml.sample", "config/cache.yml"
end
unless File.exist?("config/queue.yml")
FileUtils.cp "config/queue.yml.sample", "config/queue.yml"
end

unless File.exist?("config/credentials.yml.enc")
puts "\n== Generating credential files =="
system! "EDITOR=cat bin/rails credentials:edit"
end

puts "\n== Preparing database =="
system! "bin/rails db:prepare"
Expand Down
File renamed without changes.
3 changes: 2 additions & 1 deletion config/database.yml.example → config/database.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ default: &default
host: <%= ENV["DB_HOST"] %>
username: postgres
password: postgres
<% elsif ENV["DATABASE_URL"] %>
url: <%= ENV["DATABASE_URL"] %>
<% end %>


development:
<<: *default
database: messaging_relay_development
Expand Down
File renamed without changes.

0 comments on commit d86dceb

Please sign in to comment.