File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -984,6 +984,7 @@ def config(self, args):
984984 config:set set environment variables for an app
985985 config:unset unset environment variables for an app
986986 config:pull extract environment variables to .env
987+ config:push set environment variables from .env
987988
988989 Use `deis help [command]` to learn more.
989990 """
@@ -1184,6 +1185,30 @@ def config_pull(self, args):
11841185 else :
11851186 raise ResponseError (response )
11861187
1188+ def config_push (self , args ):
1189+ """
1190+ Sets environment variables for an application.
1191+
1192+ Your environment is read from a file named .env. This file can be
1193+ read by foreman to load the local environment for your app.
1194+
1195+ Usage: deis config:push [options]
1196+
1197+ Options:
1198+ -a --app=<app>
1199+ the uniquely identifiable name for the application.
1200+ """
1201+ app = args .get ('--app' )
1202+ if not app :
1203+ app = self ._session .app
1204+ # read from .env
1205+ try :
1206+ with open ('.env' , 'r' ) as f :
1207+ self ._config_set (app , dictify ([line .strip () for line in f ]))
1208+ except IOError :
1209+ self ._logger .error ('could not read from local env' )
1210+ sys .exit (1 )
1211+
11871212 def domains (self , args ):
11881213 """
11891214 Valid commands for domains:
You can’t perform that action at this time.
0 commit comments