Tôi đã khởi tạo hai ứng dụng Heroku thành công: my-app-prod và thử nghiệm ứng dụng của tôi. Có các biến môi trường cụ thể mà tôi đã định cấu hình trong cài đặt ứng dụng Heroku. Tôi đang sử dụng các tệp cấu hình chuẩn trong Phoenix: config.exs, test.exs, prod.exs, dev.exs.Cài đặt MIX_ENV trong Heroku cho Phoenix Framework
Sau khi định cấu hình thử nghiệm ứng dụng của tôi trong Heroku với biến ứng dụng MIX_ENV = test, nó vẫn đang tải biến từ prod.exs.
Tôi có thiếu các bước bổ sung nào để ứng dụng của tôi sử dụng test.exs không?
tôi theo tất cả các hướng dẫn tại đây: https://hexdocs.pm/phoenix/heroku.html
Khi tôi chạy git push, tôi có thể xác minh nó bằng prod.exs dựa trên đầu ra sau đây.
remote: Generated my_phoenix_app_name app
remote: -----> Creating .profile.d with env vars
remote: -----> Writing export for multi-buildpack support
remote: -----> Executing post compile: pwd
remote: /tmp/build_f5b9e6e5890fcb58b9689f433c554c6a
remote: -----> Phoenix app detected
remote:
remote: -----> Loading configuration and environment
remote: Loading config...
remote: Detecting assets directory
remote: * package.json found in custom directory
remote: Will use phoenix configuration:
remote: * assets path .
remote: * mix tasks namespace phoenix
remote: Will use the following versions:
remote: * Node 5.3.0
remote: Will export the following config vars:
remote: CLIENT_ID
remote: DATABASE_URL
remote: POOL_SIZE
remote: SECRET_KEY_BASE
remote: SHOPIFY_SECRET
remote: * MIX_ENV=prod
Có vẻ như nó đang lưu trữ các biến tại thời gian biên dịch. Bạn có đang chạy ứng dụng với 'mix phoenix.server' hoặc sử dụng bản phát hành chưng cất không? –
Đã cập nhật bài đăng, cảm ơn. – sheldonkreger