File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -26,12 +26,11 @@ def get_access_token() -> str:
2626 return response .json ()["access_token" ] # type: ignore
2727
2828
29- def create_instance (access_token : str ) -> Dict [str , Any ]:
29+ def create_instance (name : str , access_token : str ) -> Dict [str , Any ]:
3030 CREATE_OK_MAX_WAIT_TIME = 10
31- MAX_INT = 2 ** 31
3231
3332 data = {
34- "name" : "ci-instance-" + str ( rd . randint ( 0 , MAX_INT )) ,
33+ "name" : name ,
3534 "memory" : "8GB" ,
3635 "version" : "5" ,
3736 "region" : "europe-west1" ,
@@ -151,7 +150,10 @@ def main() -> None:
151150 access_token = get_access_token ()
152151 logging .info ("Access token for creation acquired" )
153152
154- create_result = create_instance (access_token )
153+ MAX_INT = 1000000
154+ instance_name = f"ci-build-{ sys .argv [2 ]} " if len (sys .argv ) > 1 else "ci-instance-" + str (rd .randint (0 , MAX_INT ))
155+
156+ create_result = create_instance (instance_name , access_token )
155157 instance_id = create_result ["id" ]
156158 logging .info ("Creation of database accepted" )
157159
You can’t perform that action at this time.
0 commit comments