22import json
33import os
44import sys
5+ from typing import List , Optional
56
67import aiohttp
78import colorama
@@ -106,7 +107,7 @@ async def get_deployment_statuses(self, deployment_id: int) -> list:
106107 reverse = True )
107108
108109 async def create_deployment (self , ref : str , environment : str , transient : bool , production : bool , task : str ,
109- description : str ):
110+ description : str , required_contexts : Optional [ List [ str ]] ):
110111 return await self .post (f"/repos/{ self .repo_path } /deployments" , {
111112 "ref" : ref ,
112113 "auto_merge" : False ,
@@ -115,7 +116,7 @@ async def create_deployment(self, ref: str, environment: str, transient: bool, p
115116 "production_environment" : production ,
116117 "task" : task ,
117118 "description" : description ,
118- "required_contexts" : [], # TODO
119+ "required_contexts" : required_contexts ,
119120 })
120121
121122 async def create_deployment_status (self , deployment_id : int , state : DeploymentState , environment : str ,
@@ -197,14 +198,16 @@ async def inspect(self, deployment_id: int):
197198
198199 print (tabulate .tabulate (tbl , headers = "keys" ))
199200
200- async def deploy (self , environment : str , ref : str , transient : bool , production : bool , task : str , description : str ):
201+ async def deploy (self , environment : str , ref : str , transient : bool , production : bool , task : str , description : str ,
202+ required_contexts : Optional [List [str ]]):
201203 print_info ("Creating deployment" )
202204 deployment_creation_result = await self .create_deployment (ref = ref ,
203205 environment = environment ,
204206 transient = transient ,
205207 production = production ,
206208 task = task ,
207- description = description )
209+ description = description ,
210+ required_contexts = required_contexts )
208211 if "id" not in deployment_creation_result :
209212 print (deployment_creation_result )
210213 raise RuntimeError ()
0 commit comments