elixir - 获取“无法配置”版本!与酿酒厂
问题描述
我正在尝试发布 Distillery 版本并Unable to configure release!
在运行时收到消息_build/dev/rel/acompanhante/bin/acompanhante foreground
。
酒厂的发布配置模块用于:
...
alias Distillery.Releases.Config.Providers.Elixir, as: RuntimeConfig
environment :dev do
set dev_mode: true
set include_erts: false
set cookie: :"gOjXA4x?QPjR0c*$/yIq9{S&/s]p}}K?gNz_$O4Uf6I[Ql/L(g7*:st70YPY={?$"
end
environment :prod do
set include_erts: true
set include_src: false
set cookie: :"OzWR<VV9?T=2o=F@9KxRTTm|CIGO/BoT9p_^D/QN6CY3}v<4?;yRjhR(v^nz1fvR"
set vm_args: "rel/vm.args"
end
release :acompanhante do
set config_providers: [{RuntimeConfig, ["${RELEASE_ROOT_DIR}/etc/config.exs"]}]
set overlays: [{:copy, "config/releases.exs", "etc/config.exs"}]
set version: current_version(:acompanhante)
set applications: [
:runtime_tools,
:logger
]
end
用于配置运行时的模块:
import Config
...
config :acompanhante, Acompanhante.Repo,
adapter: Ecto.Adapters.Postgres,
ssl: true,
url: database_url,
pool_size: String.to_integer(System.get_env("POOL_SIZE") || "10")
config :acompanhante, AcompanhanteWeb.Endpoint,
http: [
port: String.to_integer(System.get_env("PORT") || "4000"),
transport_options: [socket_opts: [:inet6]]
],
secret_key_base: secret_key_base,
code_reloader: false
我在构建应用程序时做错了什么?
解决方案
需要配置运行时:
release :acompanhante do
set config_providers: [{RuntimeConfig, ["${RELEASE_ROOT_DIR}/etc/runtime.exs"]}]
set overlays: [{:copy, "config/releases.exs", "etc/runtime.exs"}]
...
end
推荐阅读
- android - 尝试使用 proguard 运行测试
- python - WTForms 仅在输入小于 3 的字符时才返回 None
- javascript - 进行多个异步调用而不相互依赖
- java - Base64 JP2 转 JPEG 或 PNG
- c# - 自动化项目无法识别和运行功能文件
- ruby-on-rails - Rails 关联 has_many 通过:未初始化的常量错误应该很容易回答:我是初学者
- elasticsearch - Elasticsearch 和 Kibana 始终显示具有堆限制的面板
- html - 如何在 CSS Firefox 动画中使用边距
- laravel - Arduino POST 对 Laravel API 的请求
- python - 在 Python 中迭代类的实例