@ -213,16 +213,24 @@ class ArtifactDeploymentApi:
self . execution_api = ExecutionApi ( )
self . execution_api = ExecutionApi ( )
def post_release ( self , target_url : str , token : str , tag : str ) :
def post_release ( self , target_url : str , token : str , tag : str ) :
self . execution_api . execute_secure ( f " curl -X ' POST ' ' { target_url } ' -H ' accept: application/json ' -H ' Content-Type: application/json ' -d " +
self . execution_api . execute_secure ( f ' curl -X " POST " " { target_url } " '
" ' { \" body \" : \" Provides files for release " + tag + " \\ nAttention: The \\ \" Source Code \\ \" -files below are not up-to-date! \" , " + f " \" tag_name \" : \" { tag } \" " + " } ' " +
+ ' -H " accept: application/json " -H " Content-Type: application/json " '
f " -H \" Authorization: token { token } \" " )
+ f ' -d " {{ " body " : " Provides files for release { tag } Attention: The " Source Code " -files below are not up-to-date! " , " tag_name " : " { tag } " }} " ' # noqa: E501
+ f ' -H " Authorization: token { token } " ' ,
def post_asset ( self , target_url : str , release_id : str , token : str , attachment : str , type : str ) :
sanitized_command = f ' curl -X " POST " " { target_url } " '
self . execution_api . execute_secure ( f " curl -X ' POST ' ' { target_url } / { release_id } /assets ' -H ' accept: application/json ' -H \" Authorization: token { token } \" -H ' Content-Type: multipart/form-data ' -F ' attachment=@ { attachment } ;type= { type } ' " )
+ ' -H " accept: application/json " -H " Content-Type: application/json " '
+ f ' -d " {{ " body " : " Provides files for release { tag } Attention: The " Source Code " -files below are not up-to-date! " , " tag_name " : " { tag } " }} " ' ) # noqa: E501
def post_asset ( self , target_url : str , release_id : str , token : str , attachment : str , attachment_type : str ) :
self . execution_api . execute_secure ( f ' curl -X " POST " " { target_url } / { release_id } /assets " '
+ f ' -H " accept: application/json " -H " Authorization: token { token } " '
+ ' -H " Content-Type: multipart/form-data " '
+ f ' -F " attachment=@ { attachment } ;type= { attachment_type } " ' ,
sanitized_command = f ' curl -X " POST " " { target_url } / { release_id } /assets " '
+ ' -H " accept: application/json " '
+ ' -H " Content-Type: multipart/form-data " '
+ f ' -F " attachment=@ { attachment } ;type= { attachment_type } " ' )
def calculate_checksums ( self , build_path : str ) :
def calculate_checksums ( self , build_path : str ) :
self . execution_api . execute ( " find " + build_path + " -type f -exec sha256sum {} \\ ; | sort > " + build_path + " sha256sum.lst " )
self . execution_api . execute ( f " find { build_path } -type f -exec sha256sum {{ }} ; | sort > { build_path } sha256sum.lst " )
self . execution_api . execute ( " find " + build_path + " -type f -exec sha512sum {} \\ ; | sort > " + build_path + " sha512sum.lst " )
self . execution_api . execute ( f " find { build_path } -type f -exec sha512sum {{ }} ; | sort > { build_path } sha512sum.lst " )