I want to deploy staging and production/dev(for now on the same server). I am using distillery and edeliver with prod.secret.exs and environment variables. But neither environment variables or prod.secret.exs works the way I wanted. prod.secret.exs only works at compile time and environment variables are global. Any workaround I can make get some variables e.g database credentials and ports dynamically?
I dont know much about BEAM instances. but I think you mean using different LINK_SYS_CONFIG(ie. per beam process?) and here is what my .deliver/config looks like
if [[ "$DEPLOY_ENVIRONMENT" = "staging" ]]; then
elif [[ "$DEPLOY_ENVIRONMENT" = "production" ]]; then
But now I am getting cat: /home/tanweer/production/app_release/haitracker/releases/0.1.3/sys.config: No such file or directory error. although it should look for /home/tanweer/production/app_release/haitracker.config file but it doesnt, (still looking for ...releases/0.1.3/sys.config, dont know if thats how its supposed to be.)
Then try making .profile app-specific, I guess. You can create two user accounts on your machine, one for staging and one for production with each having their own .profile. But yeah, I wouldn’t use .profile for configuring apps.