environment variables - Using rake to run a file -


i have environment variables of app in file this:

export variable=value ... etc 

when run tests, have remember run file before, or tests fail. created task in rakefile automatically run file before running tests. not working.

i tried this:

task :env_test { sh('source ./credentials/.env_test') } 

but error:

source ./credentials/.env_test rake aborted! command failed status (127): [source ./credentials/.env_test...] 

i tried:

task :env_test { `source ./credentials/.env_test` } 

and got:

rake aborted! errno::enoent: no such file or directory - source 

i tried:

task :env_test { `. ./credentials/.env_test` } 

for tests using environment variables fail.

finally tried:

task :env_test { `./credentials/.env_test` } 

and again tests fail.

what doing wrong?


Comments

Popular posts from this blog

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -

python - Error while using APScheduler: 'NoneType' object has no attribute 'now' -