Hello,
The goal is to increase deployment process understanding and to run migrations prior to hot upgrade in Phoenix umbrella app deployed with distillery and edeliver.
After reading Migrations with hot code upgrade · Issue #102 · edeliver/edeliver · GitHub and looking into the code my understanding is that there should be 2 modules to make it happen:
- overridden
MigrationModificationthat will add second module to the relup file thus making “system” (edeliver?) to execute it during specific point at the upgrade process - module implementing
RunnableInstructionbehavior that will actually run the migrations
I assume that first module is needed during release assembly process and second should be compiled in the applications and accessible at runtime.
So I put them into apps/xxx_web/lib/relup as upgrade_modification.ex and run_migrations.ex with exactly the sane content that bharendt provided in the comment Migrations with hot code upgrade · Issue #102 · edeliver/edeliver · GitHub (it makes sense!) but nothing happend.
I also tried to add def usable?(_config), do: true but that didn’t help as well.
Any suggestions?
UPDATE: I added a plugin AppName.Relup.UpgradeModification directive to the distillery config as it pointed out in Updates to distillery integration by dmarkow · Pull Request #248 · edeliver/edeliver · GitHub and now can see
==> Modifying relup file...
==> Using AppName.Relup.UpgradeModification module for relup modification.
during deployment but migrations are still pending.
Seems that modify_relup is not called, since I can’t see neither info message nor a file being created
defmodule AppName.Relup.UpgradeModification do
use Edeliver.Relup.Modification
require Logger
def modify_relup(instructions, config) do
Logger.info "Running custom release modifications..."
File.touch("/tmp/upgrade-modifications")
instructions |> Edeliver.Relup.PhoenixModification.modify_relup(config)
|> AppName.Relup.Instructions.RunMigrations.modify_relup(config)
end
def priority, do: priority_user()
def usable?(_config), do: true
end
Also, module responsible for running migrations AppName.Relup.Instructions.RunMigrations doesn’t show up in relup






















