Skip to content

Commit

Permalink
Fixup storage configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
crespire committed Oct 17, 2024
1 parent 6662671 commit 89702ff
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ runs:
shell: bash
run: |
cp config/database.yml.sample config/database.yml
cp config/storage.yml.sample config/storage.yml
RAILS_ENV=test bundle exec rails db:setup
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
with:
bundler-cache: true

- name: Setup Test Database
uses: ./.github/actions/setup-database
- name: Setup Project
uses: ./.github/actions/setup-services

- name: Precompile Assets
run: bundle exec rails assets:precompile
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ COPY . .

# Use sample configs
RUN mv config/database.yml.production config/database.yml 2>/dev/null || true
RUN mv config/storage.example.yml config/storage.yml 2>/dev/null || true
RUN mv config/storage.yml.production config/storage.yml 2>/dev/null || true

# Precompile bootsnap code for faster boot times
RUN bundle exec bootsnap precompile app/ lib/
Expand Down
34 changes: 34 additions & 0 deletions config/storage.yml.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
test:
service: Disk
root: <%= Rails.root.join("tmp/storage") %>

local:
service: Disk
root: <%= Rails.root.join("storage") %>

# Use bin/rails credentials:edit to set the AWS secrets (as aws:access_key_id|secret_access_key)
# amazon:
# service: S3
# access_key_id: <%= Rails.application.credentials.dig(:aws, :access_key_id) %>
# secret_access_key: <%= Rails.application.credentials.dig(:aws, :secret_access_key) %>
# region: us-east-1
# bucket: your_own_bucket-<%= Rails.env %>

# Remember not to checkin your GCS keyfile to a repository
# google:
# service: GCS
# project: your_project
# credentials: <%= Rails.root.join("path/to/gcs.keyfile") %>
# bucket: your_own_bucket-<%= Rails.env %>

# Use bin/rails credentials:edit to set the Azure Storage secret (as azure_storage:storage_access_key)
# microsoft:
# service: AzureStorage
# storage_account_name: your_account_name
# storage_access_key: <%= Rails.application.credentials.dig(:azure_storage, :storage_access_key) %>
# container: your_container_name-<%= Rails.env %>

# mirror:
# service: Mirror
# primary: local
# mirrors: [ amazon, google, microsoft ]

0 comments on commit 89702ff

Please sign in to comment.