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

run super-early boot hooks before dotenv load #192

Merged
merged 1 commit into from
Jan 20, 2022
Merged

Conversation

tongueroo
Copy link
Contributor

@tongueroo tongueroo commented Jan 20, 2022

This is a 🐞 bug fix.

  • I've added tests (if it's a bug, feature or enhancement)
  • I've adjusted the documentation (if it's a feature or enhancement)
  • The test suite passes (run bundle exec rspec to verify this)

Summary

Run super-early boot hooks before dotenv load. This is important because the dotenv load will use the Teraspace.env and then it's already too late to use boot hooks to set the default TS_ENV. Will update dotenv docs with a config/inits initializer to show users how to check that dotenv is working.

Docs:

Context

How to Test

config/boot.rb

ENV['TS_ENV'] ||= 'qa'
puts "boot.rb called: Terraspace.env #{Terraspace.env}"
puts "boot.rb called: ENV['TS_ENV'] #{ENV['TS_ENV']}"

Run something like

terraspace plan demo

And confirm that the terraspace-cache folder has qa in the path instead of dev. IE:

.terraspace-cache/us-west-2/qa/stacks/demo

Version Changes

Patch

@tongueroo tongueroo merged commit 1268267 into master Jan 20, 2022
@tongueroo tongueroo deleted the boot-hook branch January 20, 2022 23:18
@tongueroo
Copy link
Contributor Author

Released in 1.0.3

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 this pull request may close these issues.

boot.rb won't work with terraspace version 1.0.2
1 participant