Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using precompiled on private project without publishing to hex #26

Closed
123mitnik opened this issue Aug 15, 2022 · 3 comments
Closed

Using precompiled on private project without publishing to hex #26

123mitnik opened this issue Aug 15, 2022 · 3 comments

Comments

@123mitnik
Copy link

I'm sorry if this is already somewhere covered, but I can't find how we can use the lib for downloading the binaries from an external source without publishing to hex.

What would be the workflow if:

  • you have a private project and would like to deploy to prod without publishing to hex
  • can you include the pre-build binaries inside the project itself - i.e. basically skipping the rust build process - only the elixir project compilation to be performed (inside the code - i see there is an option to read from cache - but is there an option to explicitly load local pre-build without package publishing or uploading to external servers - load from local path)?

Thank You !

@philss
Copy link
Owner

philss commented Aug 15, 2022

hey @123mitnik 👋

you have a private project and would like to deploy to prod without publishing to hex

I had to do this while testing some of the release process. What I did was really just use GitHub Releases to create a new release and point to the repository at my mix.exs. I think this is the way to go, using tags to ensure that you are using an specific version.

can you include the pre-build binaries inside the project itself - i.e. basically skipping the rust build process - only the elixir project compilation to be performed (inside the code - i see there is an option to read from cache - but is there an option to explicitly load local pre-build without package publishing or uploading to external servers - load from local path)?

There is no explicit option for that, but you could "force" the cache dir to be something known by setting the MIX_XDG env dir (see https://hexdocs.pm/mix/1.13.4/Mix.html#module-environment-variables) to "true" and setting the XDG_CACHE_HOME to a path you know. And then you can use the mix rustler_precompiled.download --all to download all the artifacts to that dir. If you want, you can distribute everything together, because the cache dir will have priority over downloading from the internet. But remember that you must set the MIX_XDG to "true" and XDG_CACHE_HOME to the same path that you downloaded the artifacts before. Note that this may affect the cache of other things used by Mix.

@philss
Copy link
Owner

philss commented Aug 15, 2022

Another important thing that I remembered: you need to add the metadata file to version control.

@123mitnik
Copy link
Author

Thank You @philss Philip ! Much appreciated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants