This was super helpful! I had my CI already setup, but it broke when I made changes to the test.exs config to get my tests to run in the containers. After digging around I had this in the config file:
test.exs
if System.get_env("GITHUB_ACTIONS") do config :my_app, MyApp.Repo, hostname: "db" end
But I like how you handled it with:
hostname: System.get_env("DB_HOST") || "localhost"
I saw your ElixirConf talk, so I think it's just that much better that I ran across this post and it helped me write better code.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
This was super helpful! I had my CI already setup, but it broke when I made changes to the
test.exs
config to get my tests to run in the containers. After digging around I had this in the config file:But I like how you handled it with:
hostname: System.get_env("DB_HOST") || "localhost"
I saw your ElixirConf talk, so I think it's just that much better that I ran across this post and it helped me write better code.