|
|
|
@ -224,14 +224,15 @@ class ArtifactDeploymentApi:
|
|
|
|
|
self.execution_api = ExecutionApi()
|
|
|
|
|
|
|
|
|
|
def create_forgejo_release(self, api_endpoint_url: str, tag: str, token: str):
|
|
|
|
|
sanitized_command = (
|
|
|
|
|
command = (
|
|
|
|
|
f'curl -X "POST" "{api_endpoint_url}" '
|
|
|
|
|
+ '-H "accept: application/json" -H "Content-Type: application/json" '
|
|
|
|
|
+ f'-d \'{{ "body": "Provides files for release {tag}", "tag_name": "{tag}"}}\' '
|
|
|
|
|
+ ' -H "accept: application/json" -H "Content-Type: application/json"'
|
|
|
|
|
+ f' -d \'{{ "body": "Provides files for release {tag}", "tag_name": "{tag}"}}\''
|
|
|
|
|
) # noqa: E501
|
|
|
|
|
command = sanitized_command + f'-H "Authorization: token {token}"'
|
|
|
|
|
print(command + ' -H "Authorization: token xxxx"')
|
|
|
|
|
return self.execution_api.execute_secure(
|
|
|
|
|
command=command, sanitized_command=sanitized_command
|
|
|
|
|
command=command + f' -H "Authorization: token {token}"',
|
|
|
|
|
sanitized_command=command + ' -H "Authorization: token xxxx"',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def add_asset_to_release(
|
|
|
|
@ -241,15 +242,16 @@ class ArtifactDeploymentApi:
|
|
|
|
|
attachment_type: str,
|
|
|
|
|
token: str,
|
|
|
|
|
):
|
|
|
|
|
command = (
|
|
|
|
|
f'curl -X "POST" "{api_endpoint_url}"'
|
|
|
|
|
+ ' -H "accept: application/json"'
|
|
|
|
|
+ ' -H "Content-Type: multipart/form-data"'
|
|
|
|
|
+ f' -F "attachment=@{attachment};type={attachment_type}"'
|
|
|
|
|
) # noqa: E501
|
|
|
|
|
print(command + ' -H "Authorization: token xxxx"')
|
|
|
|
|
return self.execution_api.execute_secure(
|
|
|
|
|
f'curl -X "POST" "{api_endpoint_url}" '
|
|
|
|
|
+ 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" "{api_endpoint_url}" '
|
|
|
|
|
+ '-H "accept: application/json" '
|
|
|
|
|
+ '-H "Content-Type: multipart/form-data" '
|
|
|
|
|
+ f'-F "attachment=@{attachment};type={attachment_type}"',
|
|
|
|
|
command=command + f' -H "Authorization: token {token}"',
|
|
|
|
|
sanitized_command=command + ' -H "Authorization: token xxxx"',
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
def calculate_sha256(self, path: Path):
|
|
|
|
|