Coder Social home page Coder Social logo

Comments (11)

bitwalker avatar bitwalker commented on July 26, 2024

@jsvisa How are you accessing the config files in etc from your release? The convention in Elixir projects is to store custom one-off files in priv, which will then be available in lib/myapp-<version>/priv in the release package. Is there a particular reason you don't want to follow that convention?

from exrm.

jsvisa avatar jsvisa commented on July 26, 2024

@bitwalker At the beginning of the app's booting, it will read the config file in etc directory, and these custom config will not put into Application.env, but a single Process contains all those configs. I put those config in this directory just because the operator can modify the file directory, If in lib/myapp-/priv, the path is to deep, but in etc directory, it's clearly.

from exrm.

bitwalker avatar bitwalker commented on July 26, 2024

I think my approach to this will be to add a helper function for adding files to the myapp-<version>.tar.gz file from plugins, using the after_release callback. You can then create a simple plugin to add additional files to that package as needed. This has the added benefit of being more flexible by giving you full control over what files are added, and how they are added (for instance you could add binary data directly to the package, while transforming it along the way).

Sound good to you?

from exrm.

ericmj avatar ericmj commented on July 26, 2024

I think exrm should follow OTP conventions, if you don't want to follow OTP conventions you can modify the release after exrm created it.

from exrm.

bitwalker avatar bitwalker commented on July 26, 2024

@ericmj I agree, which is why I won't be supporting this via exrm directly. I already have code which manipulates the release package though, so exposing that to plugin authors leaves it up to them whether they wish to adhere to those principles or do something custom like this.

from exrm.

jsvisa avatar jsvisa commented on July 26, 2024

@bitwalker I'm sorry, after_release callback couldn't do anything. because execute_after_hooks is invoked before update_release_packageL71, the later creates the tar package L337 . In my opinion, should execute_after_hook invoked after update_release_package, this following the literal meaning of after_release

from exrm.

bitwalker avatar bitwalker commented on July 26, 2024

@jsvisa This is a proposed change to allow it to work. The tar file can always be modified after it's created, and I can change the time at which it's built as well. So in theory, what I'm asking is if adding the ability to add files to the tar in after_release is an acceptable fix for you?

from exrm.

jsvisa avatar jsvisa commented on July 26, 2024

@bitwalker Yeah, this could works, Thanks:)

from exrm.

tsloughter avatar tsloughter commented on July 26, 2024

If etc is listed in the overlay then it will be included in the tar file. This was a bug in relx before but was fixed in August, erlware/relx@e3842ab

from exrm.

bitwalker avatar bitwalker commented on July 26, 2024

@tsloughter I'll have to update my relx dependency to grab that fix. As it stands I need to pull in relx as a lib rather than as an executable anyways, so this might be the time to do that.

from exrm.

tsloughter avatar tsloughter commented on July 26, 2024

Cool. Let me know if there is anything I can do to help with that.

from exrm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.