Я выбрал другой путь, поскольку оверлеи не дают никакой гибкости при использовании steps
:
web: [
applications: [my_app: :permanent],
config_providers: [
{Config.Reader, {:system, "RELEASE_ROOT", "apps/my_app/config/releases.exs"}},
{Config.Reader, {:system, "RELEASE_ROOT", "apps/another_app/config/releases.exs"}},
],
steps: [:assemble, ©_configs/1]
]
Таким образом, я могу извлечь path
и config_providers
и переместить их в папку релизов:
defp copy_configs(%{path: path, config_providers: config_providers} = release) do
for {_module, {_context, _root, file_path}} <- config_providers do
# Creating new path
new_path = path <> Path.dirname(file_path)
# Removing possible leftover files from previous builds
File.rm_rf!(new_path)
# Creating directory if it doesn't exist
File.mkdir_p!(new_path)
# Copying files to the directory with the same name
File.cp!(Path.expand(file_path), new_path <> "/" <> Path.basename(file_path))
end
release
end