Skip to content

Commit c32b775

Browse files
committed
Merge pull request #3526 from onbjerg/client-dotenv
feat(client): add optional path to config:push
2 parents ebcc410 + e7d96e3 commit c32b775

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

client/deis.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1182,6 +1182,7 @@ def config_set(self, args):
11821182
app = args.get('--app')
11831183
if not app:
11841184
app = self._session.app
1185+
11851186
values = dictify(args['<var>=<value>'])
11861187
if values.get('SSH_KEY'):
11871188
if os.path.isfile(values.get('SSH_KEY')):
@@ -1327,24 +1328,27 @@ def config_push(self, args):
13271328
"""
13281329
Sets environment variables for an application.
13291330
1330-
Your environment is read from a file named .env. This file can be
1331-
read by foreman to load the local environment for your app.
1331+
The environment is read from <path>. This file can be read by foreman
1332+
to load the local environment for your app.
13321333
13331334
Usage: deis config:push [options]
13341335
13351336
Options:
13361337
-a --app=<app>
13371338
the uniquely identifiable name for the application.
1339+
-p <path>, --path=<path>
1340+
a path leading to an environment file [default: .env]
13381341
"""
13391342
app = args.get('--app')
13401343
if not app:
13411344
app = self._session.app
1345+
13421346
# read from .env
13431347
try:
1344-
with open('.env', 'r') as f:
1348+
with open(args.get('--path'), 'r') as f:
13451349
self._config_set(app, dictify([line.strip() for line in f]))
13461350
except IOError:
1347-
self._logger.error('could not read from local env')
1351+
self._logger.error('could not read env from ' + args.get('--path'))
13481352
sys.exit(1)
13491353

13501354
def domains(self, args):

0 commit comments

Comments
 (0)