@@ -758,6 +758,31 @@ def builds(self, args):
758758 """
759759 return self .builds_list (args )
760760
761+ def builds_create (self , args ):
762+ """
763+ Create a new build of an application
764+
765+ Usage: deis builds:create <image> [--app=<app>]
766+ """
767+ app = args .get ('--app' )
768+ if not app :
769+ app = self ._session .app
770+ body = {'image' : args ['<image>' ]}
771+ sys .stdout .write ('Creating build... ' )
772+ sys .stdout .flush ()
773+ try :
774+ progress = TextProgress ()
775+ progress .start ()
776+ response = self ._dispatch ('post' , "/api/apps/{}/builds" .format (app ), json .dumps (body ))
777+ finally :
778+ progress .cancel ()
779+ progress .join ()
780+ if response .status_code == requests .codes .created : # @UndefinedVariable
781+ version = response .headers ['x-deis-release' ]
782+ print ("done, v{}" .format (version ))
783+ else :
784+ raise ResponseError (response )
785+
761786 def builds_list (self , args ):
762787 """
763788 List build history for an application
@@ -984,10 +1009,18 @@ def config_set(self, args):
9841009 if not app :
9851010 app = self ._session .app
9861011 body = {'values' : json .dumps (dictify (args ['<var>=<value>' ]))}
987- response = self ._dispatch ('post' ,
988- "/api/apps/{}/config" .format (app ),
989- json .dumps (body ))
1012+ sys .stdout .write ('Creating config... ' )
1013+ sys .stdout .flush ()
1014+ try :
1015+ progress = TextProgress ()
1016+ progress .start ()
1017+ response = self ._dispatch ('post' , "/api/apps/{}/config" .format (app ), json .dumps (body ))
1018+ finally :
1019+ progress .cancel ()
1020+ progress .join ()
9901021 if response .status_code == requests .codes .created : # @UndefinedVariable
1022+ version = response .headers ['x-deis-release' ]
1023+ print ("done, v{}\n " .format (version ))
9911024 config = response .json ()
9921025 values = json .loads (config ['values' ])
9931026 print ("=== {}" .format (app ))
@@ -1013,10 +1046,18 @@ def config_unset(self, args):
10131046 for k in args .get ('<key>' ):
10141047 values [k ] = None
10151048 body = {'values' : json .dumps (values )}
1016- response = self ._dispatch ('post' ,
1017- "/api/apps/{}/config" .format (app ),
1018- json .dumps (body ))
1049+ sys .stdout .write ('Creating config... ' )
1050+ sys .stdout .flush ()
1051+ try :
1052+ progress = TextProgress ()
1053+ progress .start ()
1054+ response = self ._dispatch ('post' , "/api/apps/{}/config" .format (app ), json .dumps (body ))
1055+ finally :
1056+ progress .cancel ()
1057+ progress .join ()
10191058 if response .status_code == requests .codes .created : # @UndefinedVariable
1059+ version = response .headers ['x-deis-release' ]
1060+ print ("done, v{}\n " .format (version ))
10201061 config = response .json ()
10211062 values = json .loads (config ['values' ])
10221063 print ("=== {}" .format (app ))
0 commit comments