Drop run_directory configuration option
We need to drop to be fixed so multiple applications put the config in the same place.
This commit is contained in:
@@ -202,15 +202,11 @@ class Kamal::Configuration
|
|||||||
|
|
||||||
|
|
||||||
def run_directory
|
def run_directory
|
||||||
raw_config.run_directory || ".kamal"
|
".kamal"
|
||||||
end
|
end
|
||||||
|
|
||||||
def run_directory_as_docker_volume
|
def run_directory_as_docker_volume
|
||||||
if Pathname.new(run_directory).absolute?
|
File.join "$(pwd)", run_directory
|
||||||
run_directory
|
|
||||||
else
|
|
||||||
File.join "$(pwd)", run_directory
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def hooks_path
|
def hooks_path
|
||||||
|
|||||||
@@ -12,10 +12,6 @@ class CommandsServerTest < ActiveSupport::TestCase
|
|||||||
assert_equal "mkdir -p .kamal", new_command.ensure_run_directory.join(" ")
|
assert_equal "mkdir -p .kamal", new_command.ensure_run_directory.join(" ")
|
||||||
end
|
end
|
||||||
|
|
||||||
test "ensure non default run directory" do
|
|
||||||
assert_equal "mkdir -p /var/run/kamal", new_command(run_directory: "/var/run/kamal").ensure_run_directory.join(" ")
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
def new_command(extra_config = {})
|
def new_command(extra_config = {})
|
||||||
Kamal::Commands::Server.new(Kamal::Configuration.new(@config.merge(extra_config)))
|
Kamal::Commands::Server.new(Kamal::Configuration.new(@config.merge(extra_config)))
|
||||||
|
|||||||
@@ -294,17 +294,11 @@ class ConfigurationTest < ActiveSupport::TestCase
|
|||||||
test "run directory" do
|
test "run directory" do
|
||||||
config = Kamal::Configuration.new(@deploy)
|
config = Kamal::Configuration.new(@deploy)
|
||||||
assert_equal ".kamal", config.run_directory
|
assert_equal ".kamal", config.run_directory
|
||||||
|
|
||||||
config = Kamal::Configuration.new(@deploy.merge!(run_directory: "/root/kamal"))
|
|
||||||
assert_equal "/root/kamal", config.run_directory
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "run directory as docker volume" do
|
test "run directory as docker volume" do
|
||||||
config = Kamal::Configuration.new(@deploy)
|
config = Kamal::Configuration.new(@deploy)
|
||||||
assert_equal "$(pwd)/.kamal", config.run_directory_as_docker_volume
|
assert_equal "$(pwd)/.kamal", config.run_directory_as_docker_volume
|
||||||
|
|
||||||
config = Kamal::Configuration.new(@deploy.merge!(run_directory: "/root/kamal"))
|
|
||||||
assert_equal "/root/kamal", config.run_directory_as_docker_volume
|
|
||||||
end
|
end
|
||||||
|
|
||||||
test "run id" do
|
test "run id" do
|
||||||
|
|||||||
Reference in New Issue
Block a user