bootleg
bootleg copied to clipboard
Hot upgrade support
It seams that rollup updates are not supported. Any intention on supporting them?
Thanks for getting in touch @edimoldovan. I'm not sure exactly what you mean by a rollup update in this context. Can you give us a bit more details on what you are trying to accomplish please?
He probably means hot upgrade releases where you do not stop the servers. But just upgrade the code. Was the first thing I noticed too when looking at this tool.
Sorry for the late reply. Indeed, I meant hot upgrades. This is script I used for building locally (on a mac) and deploying and running on a debian machine:
./node_modules/brunch/bin/brunch b -p && MIX_ENV=prod mix do phoenix.digest, release --env=prod --upgrade
rsync -r _build/prod/rel/web/releases/$1/web.tar.gz root@<ip>:/var/www/<folder>/web/run/releases/$1/
ssh root@<ip> <<'ENDSSH'
cd /var/www/<folder>/web/run; bin/web migrate; bin/web upgrade 0.0.7
ENDSSH
Might look a bit primitive, but it was efficient.
Thanks for the clarification! We are currently gauging community interest around support for hot upgrades, but we don’t have a specific timeline/milestone for when we will support them. We’d welcome any contributions in that direction.
The functionality shown in the snippet above can be reproduced in Bootleg using its remote macro:
use Bootleg.DSL
role :app, "example.com", workspace: "/opt/app"
task :hot_upgrade do
vsn = config(:version)
remote :app do
"./bin/web migrate"
"./bin/web upgrade #{vsn}"
end
end
$ mix bootleg.invoke hot_upgrade
You can also hook into the existing build and deployment tasks, or override the update task.
I think we can safely close this issue. Thoughts?
I've just written some new tasks for supporting Distillery 2.1 hot upgrades:
bootleg.build_upgrade build the app by calling distillery.release --upgrade, i.e. producing the relup file
bootleg.deploy_upgrade setup the release for upgrading
bootleg.hot_upgrade upgrade the running release without stopping it with the last deployed release
bootleg.upgrade packs all previous steps together
if you think they can be useful, I can submit a PR
Hi @guidotripaldi ! Yes, that sounds very useful! I'm happy to help with the functional tests if you'd like to open a PR. Thanks!
Fine, thank you! Maybe it is better I wait for you merge PR #300 to master before I set up the PR, so it will be based on an already distillery_2.1-ready Bootleg version
In the meantime I've upload the hot_upgrade branch on github, try to check if it could be ok at https://github.com/guidotripaldi/bootleg/tree/hot_upgrade
That looks great @guidotripaldi. The distillery 2.1.0 changes have now been merged into master. Thanks!
I've just submitted the PR #305 adding a hopefully useful sort of mini tutorial for the new tasks. Please let me know about the functional tests :)