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

RFC 0019: Allow RAILS_ENV to be overridden at build time #200

Closed
fg-j opened this issue Jul 19, 2022 · 2 comments · Fixed by #342
Closed

RFC 0019: Allow RAILS_ENV to be overridden at build time #200

fg-j opened this issue Jul 19, 2022 · 2 comments · Fixed by #342

Comments

@fg-j
Copy link

fg-j commented Jul 19, 2022

Paketo RFC 0019 states that users should be able to override environment variables that the buildpacks set, if they're environment variables commonly used in the language ecosystem.

In this buildpack, the assets precompile step sets RAILS_ENV in a way that ignores any user-provided value for the environment variable. This locks users into configuration that may not work for their app. For instance, to build https://github.com/pglombardo/PasswordPusher without an external DB, RAILS_ENV must be set to private.

If it's possible for the buildpack to function while respecting that environment variable, it should do so.

@robdimsdale robdimsdale added the good first issue A good first issue to get started with label Oct 17, 2022
@thedarkside
Copy link

I ran into an issue today which is worth mentioning here as well.

After i build a new rails project i observed a difference in behavior to my previous rails projects build with the exact same buildpack. After digging around ive seen the RAILS_ENV wasnt set while in my previous projects it was set!

After spending some time comparing those projects i stumbled upon the line in this project which sets the RAILS_ENV.
Well, my new rails project is an api project and thus has no asset pipeline included. Ive expected the RAILS_ENV variable to be set because it has a dependency to rails and not rails-assets in particular.

Maybe its a good idea to extract rails-only dependent stuff into its on "rails" project?

@robdimsdale
Copy link
Member

@thedarkside that's a good point. I think there's value in exploring this. I opened this issue to support Rails API applications that do not have assets.

josegonzalez added a commit to josegonzalez/rails-assets that referenced this issue Jun 20, 2023
This change allows users to set alternative values for RAILS_ENV and SECRET_KEY_BASE when precompiling assets.

Closes paketo-buildpacks#200
sophiewigmore pushed a commit that referenced this issue Jun 28, 2023
This change allows users to set alternative values for RAILS_ENV and SECRET_KEY_BASE when precompiling assets.

Closes #200
@sophiewigmore sophiewigmore added hacktoberfest Hacktoberfest eligible and removed good first issue A good first issue to get started with hacktoberfest Hacktoberfest eligible labels Oct 5, 2023
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

Successfully merging a pull request may close this issue.

4 participants