fidr
Minex allows you to create your own re-usable deployment tasks to setup deployment to your own needs. I created it to replace bash script with something more configurable/re-usable. It contains helpers to run commands locally and remotely (on the target specified by :host). It doesn’t contain specific deployment strategies, except for the example deploy tasks.
It’s possible to generate a bash script for enabled tasks (by passing a [generate_script: true] as options or using generate_script_task(...). This is useful for when you need a full shell/tty. For example when starting a remote console session)
Example deploy file:
use Minex
set(:name, "my_app")
set(:deploy_to, "/apps/#{get(:name)}")
set(:host, "deploy@1.2.3.4")
Code.require_file("deploy/tasks.exs", Path.dirname(__ENV__.file))
# expects a config/deploy/Dockerfile
public_task(:build, fn ->
command("docker container rm dummy", allow_fail: true)
command("docker build -f config/deploy/Dockerfile -t #{get(:name)} .")
command("docker create -ti --name dummy #{get(:name)}:latest bash")
command("docker cp dummy:/release.tar.gz release.tar.gz")
end)
public_task(:deploy, fn ->
run(:build)
run(:upload, ["release.tar.gz", "#{get(:deploy_to)}/release.tar.gz"])
run(:remote, fn ->
command("cd #{get(:deploy_to)}")
command("( [ -d \"bin\" ] && ./bin/#{get(:name)} stop || true )")
command("tar -zxf release.tar.gz -C .")
command("./bin/#{get(:name)} daemon")
end)
end)
Minex.run(System.argv())
Let me know your thoughts!
Trending in Announcing
I fully migrated to my own harness from Anthropic/Gemini and I think it’s time to share it. Welcome DSH, the DeepSeek Harness, fully writ...
New
Localize is the next generation localisation library for Elixir. Think of it as ex_cldr version 3.0. The first version will be released ...
New
Hello,
I’m sharing my plugin here in forum after some time so it has time to mature and proof yourself.
I use Claude Code daily on a pr...
New
Aloha gang,
There’s a new class of AI model out from TypeSafe. Jev is their flagship model. You can learn about it here:
...
New
I’ve recently created a small library phoenix_vite integrating the vite build tooling with phoenix.
It
provides an igniter.installer t...
New
I needed something like premailer for rails, and after searching, I decided to make an easy-to-use library to handle inline styles and co...
New
If you’ve ever had to debug a BEAM node you know it can be a painful process. Parsing raw data, or dealing with clutter often gets in the...
New
Other Trending Topics
Hey there,
I haven’t seen a list of useful Elixir specific skills for the popular AI tools yet so I’m starting one here with my first.
...
New
Hi everyone :waving_hand:
I wanted to share something I’ve been building — NowBlind, a random chat app designed to help people discover ...
New
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
(I just needed to vent somewhere and LinkedIn is full of hope, or hype, I’m not sure which exactly)
AI dream has many faces, but general...
New
With AI doing more of the implementation work, I’ve been wondering how much coding I should deliberately keep doing myself.
My main conc...
New
AI tools and services seem to be the new JS framework - with new ones popping up every 5 minutes - hence it might be worth posting one of...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #code-sync
- #discussion
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #ai
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #blog-post
- #elixirconf-us
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #security
- #elixirconf-eu
- #api
- #forms
- #performance










Showing Posts 1 to 6- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
hauleth
I would use similar approach to the
ExUnitforMinex.run(). So you would doSystem.at_exit(fn -> Minex.run(System.argv()) end)inMinex.__using__/1so the user would not need to remember to run it on their own (probably add a flag that would allow disabling such behaviour).Another question is - why not make it Mix task?
fidr
Thanks for the suggestions!
I’ve considered the
at_exitbut this seems more flexible. You can for example extract a target (staging/production) out of System.argv() and pass the rest toMinex.run.I did create a mix task to help run tasks:
mix minex task_name. Is that what you mean?ityonemo
I have something similar that I use internally (it’s like an elixir-ish ansible): it’s like ansible and minex in that it can either issue locally via cmd or via ssh. I’ve been thinking about open sourcing it, but am slightly afraid in that people might make fun of me for reimplementing ansible (with less yaml, things are more obviously functions, you can IO.inspect everywhere, etc etc etc). Is that something y’all might use if I open sourced it or if we joined forces?
also
generate_script: trueis really fantastic.strzibny
I would personally be curious about it!
wolf4earth
Why not both? By default you could do the
at_exit(so people do not have to remember), and provide an option for theusewhich switches that off, when the user desires to do so.Less footguns, you know?
hauleth
My proposal is like @wolf4earth said, you have: