Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d141c82efa | ||
|
|
cdb6c014ac | ||
|
|
7ded6d3aef | ||
|
|
2ea60bea5e | ||
|
|
3948a95e7a |
@@ -1,7 +1,7 @@
|
|||||||
PATH
|
PATH
|
||||||
remote: .
|
remote: .
|
||||||
specs:
|
specs:
|
||||||
kamal (1.9.2)
|
kamal (1.9.3)
|
||||||
activesupport (>= 7.0)
|
activesupport (>= 7.0)
|
||||||
base64 (~> 0.2)
|
base64 (~> 0.2)
|
||||||
bcrypt_pbkdf (~> 1.0)
|
bcrypt_pbkdf (~> 1.0)
|
||||||
@@ -78,11 +78,11 @@ GEM
|
|||||||
net-sftp (4.0.0)
|
net-sftp (4.0.0)
|
||||||
net-ssh (>= 5.0.0, < 8.0.0)
|
net-ssh (>= 5.0.0, < 8.0.0)
|
||||||
net-ssh (7.2.1)
|
net-ssh (7.2.1)
|
||||||
nokogiri (1.16.0-arm64-darwin)
|
nokogiri (1.18.8-arm64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.0-x86_64-darwin)
|
nokogiri (1.18.8-x86_64-darwin)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
nokogiri (1.16.0-x86_64-linux)
|
nokogiri (1.18.8-x86_64-linux-gnu)
|
||||||
racc (~> 1.4)
|
racc (~> 1.4)
|
||||||
parallel (1.24.0)
|
parallel (1.24.0)
|
||||||
parser (3.3.0.5)
|
parser (3.3.0.5)
|
||||||
|
|||||||
@@ -37,9 +37,9 @@ module Kamal::Cli
|
|||||||
|
|
||||||
def load_env
|
def load_env
|
||||||
if destination = options[:destination]
|
if destination = options[:destination]
|
||||||
Dotenv.load(".env.#{destination}", ".env")
|
Dotenv.overload(".env", ".env.#{destination}")
|
||||||
else
|
else
|
||||||
Dotenv.load(".env")
|
Dotenv.overload(".env")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
module Kamal
|
module Kamal
|
||||||
VERSION = "1.9.2"
|
VERSION = "1.9.3"
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -490,6 +490,39 @@ class CliMainTest < CliTestCase
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "env files overwrite shell environment variables" do
|
||||||
|
ENV["TEST_VAR"] = "shell_value"
|
||||||
|
ENV["AWS_ACCESS_KEY_ID"] = "local_dev_key"
|
||||||
|
|
||||||
|
with_test_dotenv(".env": "TEST_VAR=dotenv_value\nAWS_ACCESS_KEY_ID=production_key") do
|
||||||
|
# Create a simple CLI command instance to trigger load_env
|
||||||
|
Kamal::Cli::Main.new.send(:load_env)
|
||||||
|
|
||||||
|
assert_equal "dotenv_value", ENV["TEST_VAR"]
|
||||||
|
assert_equal "production_key", ENV["AWS_ACCESS_KEY_ID"]
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
ENV.delete("TEST_VAR")
|
||||||
|
ENV.delete("AWS_ACCESS_KEY_ID")
|
||||||
|
end
|
||||||
|
|
||||||
|
test "destination env files overwrite base env files" do
|
||||||
|
ENV["TEST_VAR"] = "shell_value"
|
||||||
|
|
||||||
|
with_test_dotenv(".env": "TEST_VAR=base_value\nBASE_ONLY=base", ".env.world": "TEST_VAR=world_value\nWORLD_ONLY=world") do
|
||||||
|
# Create CLI command with destination to trigger load_env
|
||||||
|
Kamal::Cli::Main.new([], { destination: "world" }).send(:load_env)
|
||||||
|
|
||||||
|
assert_equal "world_value", ENV["TEST_VAR"]
|
||||||
|
assert_equal "base", ENV["BASE_ONLY"]
|
||||||
|
assert_equal "world", ENV["WORLD_ONLY"]
|
||||||
|
end
|
||||||
|
ensure
|
||||||
|
ENV.delete("TEST_VAR")
|
||||||
|
ENV.delete("BASE_ONLY")
|
||||||
|
ENV.delete("WORLD_ONLY")
|
||||||
|
end
|
||||||
|
|
||||||
test "remove with confirmation" do
|
test "remove with confirmation" do
|
||||||
run_command("remove", "-y", config_file: "deploy_with_accessories").tap do |output|
|
run_command("remove", "-y", config_file: "deploy_with_accessories").tap do |output|
|
||||||
assert_match /docker container stop traefik/, output
|
assert_match /docker container stop traefik/, output
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
FROM registry
|
FROM registry:3
|
||||||
|
|
||||||
COPY boot.sh .
|
COPY boot.sh .
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
exec /entrypoint.sh /etc/docker/registry/config.yml
|
exec /entrypoint.sh /etc/distribution/config.yml
|
||||||
|
|||||||
Reference in New Issue
Block a user