Bottler (BETA)
Bottler is a collection of tools that aims to help you generate releases, ship them to your servers, install them there, and get them live on production.
What
Four main tools, that can be used separately:
- release: generate
tar.gzfiles with your app and its dependencies (not including the wholeertsby now). - ship: ship your generated
tar.gzviascpto every server you configure. - install: properly install your shipped release on each of those servers.
- restart: fire a quick restart to apply the newly installed release if you are using Harakiri.
You should have public key ssh access to all servers you intend to work with. Erlang runtime should be installed there too. Everything else, including Elixir itself, is included in the release.
By now it's not able to deal with all the hot code swap bolts, screws and nuts. Maybe someday will be.
Use
Add to your deps like this:
{:bottler, github: "elpulgardelpanda/bottler"}
On your config:
config :bottler, :params, [servers: [server1: [ip: "1.1.1.1"],
server2: [ip: "1.1.1.2"]],
remote_user: "produser" ]
Then you can use the tasks like mix release. Take a look at the
docs for each task with mix help <task>.
Release
Build a release file. Use like mix release.
prod environment is used by default. Use like
MIX_ENV=other_env mix release to force it to other_env.
Ship
Install
Restart
Deploy
Build a release file, ship it to remote servers, install it, and restart the app. No hot code swap for now.
Use like mix deploy.
prod environment is used by default. Use like
MIX_ENV=other_env mix deploy to force it to other_env.
TODOs
- At least some minimal testing
- Add connect script
- Get it stable on production
- Individual tasks for each step
- Add fast rollback (to any of previous versions)
- Complete README
- Add to hex
- Optionally include
erts(now we can ship openssl too see here) - Use scalable middleplace to ship releases
- Allow hot code swap?
- Support for hooks
- Add tools for docker deploys