@@ -473,10 +473,16 @@ def content_get(self, content_guid: str) -> ContentItemV1:
473473 response = self ._server .handle_bad_response (response )
474474 return response
475475
476- def content_build (self , content_guid : str , bundle_id : Optional [str ] = None ) -> BuildOutputDTO :
476+ def content_build (self , content_guid : str , bundle_id : Optional [str ] = None , activate : bool = True ) -> BuildOutputDTO :
477+ body = {"bundle_id" : bundle_id }
478+ if not activate :
479+ # The default behavior is to activate the app after building.
480+ # So we only pass the parameter if we want to deactivate it.
481+ # That way we can keep the API backwards compatible.
482+ body ["activate" ] = False
477483 response = cast (
478484 Union [BuildOutputDTO , HTTPResponse ],
479- self .post ("v1/content/%s/build" % content_guid , body = { "bundle_id" : bundle_id } ),
485+ self .post ("v1/content/%s/build" % content_guid , body = body ),
480486 )
481487 response = self ._server .handle_bad_response (response )
482488 return response
@@ -552,10 +558,10 @@ def deploy(
552558
553559 app_bundle = self .app_upload (app_id , tarball )
554560
555- task = self .app_deploy ( app_id , app_bundle ["id" ], activate = activate )
561+ task = self .content_build ( app_guid , str ( app_bundle ["id" ]) , activate = activate )
556562
557563 return {
558- "task_id" : task ["id " ],
564+ "task_id" : task ["task_id " ],
559565 "app_id" : app_id ,
560566 "app_guid" : app ["guid" ],
561567 "app_url" : app ["url" ],
0 commit comments