fix: respect pre-existing .env files when preparing the herokuish buildenv
Closes #4894
This commit is contained in:
1
tests/apps/python/.env
Normal file
1
tests/apps/python/.env
Normal file
@@ -0,0 +1 @@
|
||||
DOTENV_KEY=some_value
|
||||
@@ -5,7 +5,10 @@ import os
|
||||
def main():
|
||||
print("GLOBAL_SECRET: {0}".format(os.getenv('GLOBAL_SECRET')))
|
||||
print("SECRET_KEY: {0}".format(os.getenv('SECRET_KEY')))
|
||||
|
||||
with open("/app/.env", "r") as f:
|
||||
for line in f.readlines():
|
||||
if "DOTENV_KEY" in line:
|
||||
print(line)
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
19
tests/unit/builder-herokuish.bats
Normal file
19
tests/unit/builder-herokuish.bats
Normal file
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bats
|
||||
|
||||
load test_helper
|
||||
|
||||
setup() {
|
||||
create_app
|
||||
}
|
||||
|
||||
teardown() {
|
||||
destroy_app
|
||||
}
|
||||
|
||||
@test "(builder-herouish:build .env)" {
|
||||
run deploy_app python dokku@dokku.me:$TEST_APP
|
||||
echo "output: $output"
|
||||
echo "status: $status"
|
||||
assert_success
|
||||
assert_output_contains 'DOTENV_KEY=some_value'
|
||||
}
|
||||
Reference in New Issue
Block a user