From c02440ac65eee037d971bc5eff561038f1f7abf4 Mon Sep 17 00:00:00 2001 From: bom Date: Fri, 4 Aug 2023 11:47:55 +0200 Subject: [PATCH] Return values of post requests --- src/main/python/ddadevops/infrastructure/infrastructure.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/python/ddadevops/infrastructure/infrastructure.py b/src/main/python/ddadevops/infrastructure/infrastructure.py index 3279430..40fee1b 100644 --- a/src/main/python/ddadevops/infrastructure/infrastructure.py +++ b/src/main/python/ddadevops/infrastructure/infrastructure.py @@ -213,7 +213,7 @@ class ArtifactDeploymentApi: self.execution_api = ExecutionApi() def post_release(self, target_url: str, tag: str, token: str): - self.execution_api.execute_secure(f'curl -X "POST" "{target_url}" ' + return self.execution_api.execute_secure(f'curl -X "POST" "{target_url}" ' + '-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 + f'-H "Authorization: token {token}"', @@ -222,7 +222,7 @@ class ArtifactDeploymentApi: + 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, attachment: str, attachment_type: str, token: str): - self.execution_api.execute_secure(f'curl -X "POST" "{target_url}/{release_id}/assets" ' # {target_url}/{release_id}/assets move to Domain + return self.execution_api.execute_secure(f'curl -X "POST" "{target_url}/{release_id}/assets" ' # {target_url}/{release_id}/assets move to Domain + f'-H "accept: application/json" -H "Authorization: token {token}" ' + '-H "Content-Type: multipart/form-data" ' + f'-F "attachment=@{attachment};type={attachment_type}"',