mirror of
https://github.com/discourse/discourse.git
synced 2025-03-09 14:34:35 +00:00
FIX: Update database_restorer to avoid shell use (#12731)
Follow-up to 0ec5fd5262647633399e856b0fba93735f6d6c11
This commit is contained in:
parent
965843f3e5
commit
3436fef5e3
@ -136,7 +136,7 @@ module BackupRestore
|
|||||||
"SKIP_OPTIMIZE_ICONS" => "1",
|
"SKIP_OPTIMIZE_ICONS" => "1",
|
||||||
"DISABLE_TRANSLATION_OVERRIDES" => "1"
|
"DISABLE_TRANSLATION_OVERRIDES" => "1"
|
||||||
},
|
},
|
||||||
"rake db:migrate",
|
"rake", "db:migrate",
|
||||||
failure_message: "Failed to migrate database.",
|
failure_message: "Failed to migrate database.",
|
||||||
chdir: Rails.root
|
chdir: Rails.root
|
||||||
)
|
)
|
||||||
|
@ -35,11 +35,11 @@ describe BackupRestore::DatabaseRestorer do
|
|||||||
end
|
end
|
||||||
|
|
||||||
def expect_db_migrate
|
def expect_db_migrate
|
||||||
Discourse::Utils.expects(:execute_command).with do |env, command, options|
|
Discourse::Utils.expects(:execute_command).with do |env, *command, **options|
|
||||||
env["SKIP_POST_DEPLOYMENT_MIGRATIONS"] == "0" &&
|
env["SKIP_POST_DEPLOYMENT_MIGRATIONS"] == "0" &&
|
||||||
env["SKIP_OPTIMIZE_ICONS"] == "1" &&
|
env["SKIP_OPTIMIZE_ICONS"] == "1" &&
|
||||||
env["DISABLE_TRANSLATION_OVERRIDES"] == "1" &&
|
env["DISABLE_TRANSLATION_OVERRIDES"] == "1" &&
|
||||||
command == "rake db:migrate" &&
|
command == ["rake", "db:migrate"] &&
|
||||||
options[:chdir] == Rails.root
|
options[:chdir] == Rails.root
|
||||||
end.once
|
end.once
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user