【问题标题】:Getting `Unable to configure` release! with Distillery获取“无法配置”版本!与酿酒厂
【发布时间】:2021-11-25 04:02:47
【问题描述】:

我正在尝试发布 Distillery 版本并在运行 _build/dev/rel/acompanhante/bin/acompanhante foreground 时收到消息 Unable to configure release!

使用了酒厂的发布配置模块:

...

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

我在构建应用程序时做错了什么?

【问题讨论】:

  • 有使用 Distillery 的理由吗?你只是想以某种方式构建一个版本吗?
  • 我相信通过 distillery 我可以使用命令更顺畅地管理发布周期

标签: elixir phoenix distillery


【解决方案1】:

需要配置运行时:

release :acompanhante do
  set config_providers: [{RuntimeConfig, ["${RELEASE_ROOT_DIR}/etc/runtime.exs"]}]
  set overlays: [{:copy, "config/releases.exs", "etc/runtime.exs"}]
  ...
end

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-10
    • 2018-01-18
    • 2016-11-15
    • 1970-01-01
    • 2014-01-10
    • 2021-03-06
    相关资源
    最近更新 更多