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
WebAuthnLiveComponent WebAuthnComponents
See this post about renaming the package.
Passwordless authentication for Phoenix LiveView app...
New
Edit: 2026 May 15 - This post is archived.
Mob is alive!!
Main docs: mob v0.7.11 — Documentation
A bit of explanation for the slightly c...
New
I released Doggo, a collection of unstyled Phoenix components.
https://github.com/woylie/doggo
Features
Unstyled Phoenix components....
New
Hi everyone,
I’ve been working on this protobuf library for 3 years. We use it in the company I work for, EasyMile, to communicate with ...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
I’ll shortly be launching Text, a nascent text analysis library.
Current functionality
In this early version (not ready for prime time) ...
New
Following on from my CLDR lbraries I started work on Unicode transforms. But like everything related to CLDR there is a lot of yak-shavin...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
A little off-topic, but I feel like people here have a good head on their shoulders.
I used to be quite good at making software. Was luc...
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
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
I love Elixir. It’s one of 2 programming languages I’ve ever fallen in love with.
But I don’t use it anymore.
Serverless was the promis...
New
I just stumbled on a newly redesigned elixir-lang.org. :tada: It looks like @Software_Mansion did the work, and I think it is generally a...
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
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ai
- #ecto-query
- #elixirconf-us
- #blog-post
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #elixirconf-eu
- #api
- #forms
- #metaprogramming
- #hex










Most Liked- 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?
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.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?
Last Post!
hauleth
My proposal is like @wolf4earth said, you have: