Move int parent comment

This commit is contained in:
Donal McBreen
2024-09-04 12:52:30 +01:00
parent 3d502ab12d
commit 31a347c285

View File

@@ -6,10 +6,7 @@ class Kamal::Secrets
end end
def [](key) def [](key)
# If dot env interpolates any `kamal secrets` calls, this tells it to interrupt this process if there are errors @secrets ||= parse_secrets
ENV["KAMAL_SECRETS_INT_PARENT"] = "1"
@secrets ||= secrets_file ? Dotenv.parse(secrets_file) : {}
@secrets.fetch(key) @secrets.fetch(key)
rescue KeyError rescue KeyError
if secrets_file if secrets_file
@@ -29,6 +26,7 @@ class Kamal::Secrets
end end
def interrupting_parent_on_error def interrupting_parent_on_error
# Make any `kamal secrets` calls in dotenv interpolation interrupt this process if there are errors
ENV["KAMAL_SECRETS_INT_PARENT"] = "1" ENV["KAMAL_SECRETS_INT_PARENT"] = "1"
yield yield
ensure ensure