@@ -60,21 +60,31 @@ def handle(self, *args, **kwargs):
6060 f"--doc_language={ settings .BK_APIGW_RELEASE_DOC_LANGUAGE } " ,
6161 )
6262
63- self .stdout .write (
64- f"call create_version_and_release_apigw with definition: { definition_file_path } , stage: { settings .BK_APIGW_STAGE_NAME } "
65- )
63+ # if BK_APIGW_RESOURCE_DOCS_BASE_DIR is not empty, then sync the resource docs
64+ if hasattr (settings , "BK_APIGW_RESOURCE_DOCS_BASE_DIR" ) and settings .BK_APIGW_RESOURCE_DOCS_BASE_DIR :
65+ self .stdout .write (f"call sync_resource_docs_by_archive with definition: { definition_file_path } " )
66+ call_command (
67+ "sync_resource_docs_by_archive" ,
68+ f"--gateway-name={ gateway_name } " ,
69+ f"--file={ definition_file_path } " ,
70+ "--safe-mode" ,
71+ )
72+
73+ self .stdout .write (f"call grant_apigw_permissions with definition: { definition_file_path } " )
6674 call_command (
67- "create_version_and_release_apigw " ,
75+ "grant_apigw_permissions " ,
6876 f"--gateway-name={ gateway_name } " ,
6977 f"--file={ definition_file_path } " ,
70- f"--stage={ settings .BK_APIGW_STAGE_NAME } " ,
7178 )
7279
73- self .stdout .write (f"call grant_apigw_permissions with definition: { definition_file_path } " )
80+ self .stdout .write (
81+ f"call create_version_and_release_apigw with definition: { definition_file_path } , stage: { settings .BK_APIGW_STAGE_NAME } "
82+ )
7483 call_command (
75- "grant_apigw_permissions " ,
84+ "create_version_and_release_apigw " ,
7685 f"--gateway-name={ gateway_name } " ,
7786 f"--file={ definition_file_path } " ,
87+ f"--stage={ settings .BK_APIGW_STAGE_NAME } " ,
7888 )
7989
8090 self .stdout .write (f"call fetch_apigw_public_key { gateway_name } " )
0 commit comments