Alternative deps.get task

I need to create a mix task, that’s purpose is to replace deps.get. (The reason is that in our company we are not allowed to use any git source from the internet, like github, but have to download deps from an internal, controlled server. External deps are mirrored to the internal server when required. But in mix.exs and rebar.config, we use the original git URLs. This alternative deps.get task has to rewrite the URLs before downloading them, and when the external dep does not have an internal copy, it also has to initiate the mirroring procedure.)

My problem here is that when I create a new task, like (let’s call it deps_get), it is just an ordinary task, and wants to run the original deps.get before it runs. Is it possible to make my own task able to run without the deps being downloaded in advance? Or maybe the goal of deps_get is only achievable by allowing to download the external deps by the original deps.get, and then run another task that replaces the external deps with the internal ones?

one possible solution is to use git itself to rewrite the url

1 Like

Git rewrite urls as mentioned by @odix67: mix deps — Mix v1.13.4

You can also use Hex repositories but change the Hex repository URL / API to point to a self-hosted Hex: Self-hosting | Hex

1 Like

Hey there,
welcome to the same problem we had in my company as well. Have you checked if the following repos/projects might suffice for your problem as well. The second one is a solution that also run in my companys infrastructure and is basically built upon Wojteks idea