首页 > 解决方案 > 当有 2 个过去版本 ditillery elixir phoenix 时,热升级中断

问题描述

酒厂 2.0 版

灵丹妙药 1.7.1

一次性密码 21.0

首先,进行正常发布并使用混合发布进行部署。它在 prod/rel/app_name/releases/1.0.1-08f6b0c 中创建了一个构建

现在更改一些内容并再次使用 mix release --upgrade 创建一个版本

它在 prod/rel/app_name/releases/1.0.1-a4011918 中创建了一个新版本

并进行升级

/opt/app-name/bin/app-name upgrade 1.0.1-a4011918

现在再次进行新更改创建升级版本。版本 1.0.1-a6cf7267。

现在尝试升级,它会给出一个错误。

详细的 ansible 日志“找不到 release-evercam_media 的代码路径”,“1.0.1-08f6b0c!”

ansible + 做手册

"Could not locate code path for release-evercam_media\",\"1.0.1-08f6b0c!"
Description of issue

预期:它应该升级新的发布版本。但失败并找到了第一个发布代码?这是一个问题,有 2 个连续的版本可用,而且应该是最后一个?

我的配置文件很简单

# Import all plugins from `rel/plugins`
# They can then be used by adding `plugin MyPlugin` to
# either an environment, or release definition, where
# `MyPlugin` is the name of the plugin module.
~w(rel plugins *.exs)
|> Path.join()
|> Path.wildcard()
|> Enum.map(&Code.eval_file(&1))

use Mix.Releases.Config,
    # This sets the default release built by `mix release`
    default_release: :default,
    # This sets the default environment used by `mix release`
    default_environment: Mix.env()

# For a full list of config options for both releases
# and environments, visit https://hexdocs.pm/distillery/configuration.html


# You may define one or more environments in this file,
# an environment's settings will override those of a release
# when building in that environment, this combination of release
# and environment configuration is called a profile

environment :dev do
  # If you are running Phoenix, you should make sure that
  # server: true is set and the code reloader is disabled,
  # even in dev mode.
  # It is recommended that you build with MIX_ENV=prod and pass
  # the --env flag to Distillery explicitly if you want to use
  # dev mode.
  set dev_mode: true
  set include_erts: false
  set cookie: :"Ht*Sd&uNNB]}}E;a~a/?&n~uogVhz>@|{,5`sX(>xK{A`@M,kj`0dF{s~`ry?XdJ"
end

environment :prod do
  set include_erts: true
  set include_src: false
  set cookie: :"Qf*;>$8`bG)vnRLU[AS(HLh9:]Qd:f)]%,`!Vfl^@Nek>OeeFRtl|&chJmdb{Ml("
end

# You may define one or more releases in this file.
# If you have not set a default release, or selected one
# when running `mix release`, the first release in the file
# will be used by default

release :evercam_media do
  set version: current_version(:evercam_media)
  set applications: [
    :runtime_tools
  ]
end

问题是:为什么它在第三个版本时寻找第一个版本文件夹并且它应该从第二个版本升级。我还尝试在升级发布之前先创建应用程序并进行升级,但都没有工作。

标签: elixirdistillery

解决方案


推荐阅读