File tree Expand file tree Collapse file tree 2 files changed +30
-0
lines changed
lib/rails/generators/rails/app/templates/config Expand file tree Collapse file tree 2 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 31
31
# clear:
32
32
# DB_HOST: 192.168.0.2
33
33
34
+ <% unless skip_storage? %>
34
35
# Use a persistent storage volume for sqlite database files and local Active Storage files.
35
36
# Recommended to change this to a mounted volume path that is backed up off server.
36
37
volumes:
37
38
- "<%= app_name %>_storage:/rails/storage"
38
39
40
+ <% end %>
39
41
# Bridge fingerprinted assets, like JS and CSS, between versions to avoid
40
42
# hitting 404 on in-flight requests. Combines all files from new and old
41
43
# version inside the asset_path.
Original file line number Diff line number Diff line change @@ -668,6 +668,34 @@ def test_kamal_files_are_skipped_if_required
668
668
assert_no_file ".env.erb"
669
669
end
670
670
671
+ def test_inclusion_of_kamal_storage_volume
672
+ run_generator_and_bundler [ destination_root ]
673
+
674
+ assert_file "config/deploy.yml" do |content |
675
+ assert_match ( %r{storage:/rails/storage} , content )
676
+ end
677
+ end
678
+
679
+ def test_inclusion_of_kamal_storage_volume_if_only_skip_active_storage_is_given
680
+ run_generator_and_bundler [ destination_root , "--skip-active-storage" ]
681
+
682
+ assert_file "config/deploy.yml" do |content |
683
+ assert_match ( %r{storage:/rails/storage} , content )
684
+ end
685
+ end
686
+
687
+ def test_kamal_storage_volume_is_skipped_if_required
688
+ run_generator_and_bundler [
689
+ destination_root ,
690
+ "--skip-active-storage" ,
691
+ "--database=postgresql"
692
+ ]
693
+
694
+ assert_file "config/deploy.yml" do |content |
695
+ assert_no_match ( %r{storage:/rails/storage} , content )
696
+ end
697
+ end
698
+
671
699
def test_usage_read_from_file
672
700
assert_called ( File , :read , returns : "USAGE FROM FILE" ) do
673
701
assert_equal "USAGE FROM FILE" , Rails ::Generators ::AppGenerator . desc
You can’t perform that action at this time.
0 commit comments