上下文
我们正在尝试使用 edeliver
将 Phoenix Web 应用程序的“热升级”部署到远程虚拟机实例。
我们的目标是每次构建应用程序的“升级”版本,以便应用程序可以在生产中“热”升级而无需任何停机。
我们已经成功地在“Hello World”phoenix 应用程序上进行了“热升级”: https://github.com/nelsonic/hello_world_edeliver当构建通过时,它会从 Travis-CI 自动部署。请参阅:https://travis-ci.org/nelsonic/hello_world_edeliver/builds/259965752#L1752
因此,从理论上讲,这种技术应该适用于我们的“真实”应用程序。
尝试使用 Edeliver 部署“真正的”Phoenix 应用程序
运行以下命令(构建升级):
mix edeliver build upgrade --auto-version=git-revision --from=$(git rev-parse HEAD~) --to=$(git rev-parse HEAD) --verbose
即“构建从之前的 git 版本到当前版本的升级”
到目前为止,一切都很好。 “发布已成功构建!”
错误:vm.args:没有这样的文件或目录
当我们尝试部署升级时:
mix edeliver deploy upgrade to production --version=1.0.3+86d55eb --verbose
cat: /home/hladmin/healthlocker/releases/1.0.3+86d55eb/vm.args: No such file or directory
Note: we have a little bash script that reads the latest upgrade version available in
.deliver/releases
and deploys that see:version.sh
问题:
有没有办法忽略缺少vm.args
文件并继续部署?
或者如果完成部署需要该文件,是否有一些有关如何创建该文件的文档?
Note: we have read the distillery "Runtime Configuration" docs: https://github.com/bitwalker/distillery/blob/master/docs/Runtime%20Configuration.md and are sadly none-the-wiser ...
其他信息
环境
- 本地主机:运行 Elixir 1.4.2 的 Mac
- 构建主机:运行 Elixir 1.4.5 的 Ubuntu 16.04.2 LTS
mix.exs
文件:https://github.com/healthlocker/healthlocker/blob/continuous-delivery/mix.exsedeliver
版本:1.4.4
- 构建工具:
distillery
版本:1.4.0
- 伞式项目:是的。
最佳答案
正如其他人提到的,vm.args
文件对于 BEAM 运行该版本是必需的。默认文件是由 distillery 在发布构建过程中创建的,应位于 releases/<version>/vm.args
中。 。从您的日志输出来看,似乎正在检查预期的目录。
- 您能向我们展示
/home/hladmin/healthlocker/releases/
的内容吗? ? - 您能否确认默认
vm.args
文件是在构建版本并提取它时创建的(在升级过程之外)?
您还问:
Or if the file is required to complete the deployment, is there some documentation on how to create the file?
如果使用默认 vm.args
诊断问题文件不会让您到达任何地方,您还可以编写自己的文件并配置 distillery 以使用该文件而不是默认文件。有关详细信息,请参阅 distillery configuration docs 。简而言之,
添加vm_args
设置为您的酒厂配置,应位于 rel/config.exs
(相对于您的项目根目录),例如:
environment :prod do
set vm_args: "<path>/vm.args"
[...]
end
关于deployment - 如何避免 Edeliver 部署错误 : "vm.args: No such file or directory"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45478961/