Question

I have a project with several dependencies on remote repositories (all on github.com at the moment if that helps). The dependencies don't change often. It would be nice if there was a way to keep the existing rebar.conf files the same so that they pointed to the upstream repositories, but to be able to cache the repos (or a snapshot) locally so that clean builds don't need go to the internet.

Is there anyway of doing this? I.e. rebar command line options, environment settings, git options, etc.?

Was it helpful?

Solution

I suppose you could do couple of things:

  1. Make your own local clone of all repositories and change rebar.config to take this repos from it. On the first look it seems horrible solution, but it has a lot of advantages. Github is often not available, clone speed will increase, and the last most valuable is: projects are evolving and one day you will find that everything is broken because one of the deps has changed their APi in master branch.
  2. You could do local deps folder with all you need repos and share it via symlink with every repo you need.

OTHER TIPS

Rebar has a feature that lets you add a custom script file, rebar.config.script, to modify rebar's configuration dynamically. This lets you implement something similar to @danechkin's answer #2 except using an environment variable to switch between the local shared deps folder and the default one for the project. No changes to rebar.config needed. The example at https://github.com/basho/rebar/wiki/Dynamic-configuration shows how to do this.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top