diff --git a/config/api_platform/GitRepository.yaml b/config/api_platform/GitRepository.yaml index 6b0b09c..f414141 100644 --- a/config/api_platform/GitRepository.yaml +++ b/config/api_platform/GitRepository.yaml @@ -101,6 +101,7 @@ resources: uriTemplate: /git-repositories/deploy-image controller: App\Controller\DeployGitImageAction + git_update_image: shortName: Update Git Image description: Update Git image @@ -110,6 +111,15 @@ resources: uriTemplate: /git-repositories/update-image controller: App\Controller\UpdateGitImageAction + get_git_data: + shortName: Get Git Data + description: Get Git data + class: ApiPlatform\Metadata\Post + method: POST + input: App\Dto\Input\GetGitDataInput + uriTemplate: /git-repositories/get-git-data + controller: App\Controller\OgAgent\GetGitDataAction + properties: App\Entity\GitRepository: id: diff --git a/src/Controller/OgRepository/Git/CreateTagAction.php b/src/Controller/OgRepository/Git/CreateTagAction.php new file mode 100644 index 0000000..c8ce78e --- /dev/null +++ b/src/Controller/OgRepository/Git/CreateTagAction.php @@ -0,0 +1,37 @@ +createRequest('POST', 'http://'.$repository->getIp().':8006/ogrepository/v1/git/repositories/'.$input->repository.'/tags', [ + 'json' => [ + 'commit' => $input->commit, + 'message' => $input->message, + 'name' => $input->name + ] + ]); + + if (isset($content['error']) && $content['code'] === Response::HTTP_INTERNAL_SERVER_ERROR) { + throw new BadRequestHttpException('Error creating tag'); + } + + return new JsonResponse(data: [], status: Response::HTTP_OK); + } +} \ No newline at end of file diff --git a/src/Dto/Input/CreateTagInput.php b/src/Dto/Input/CreateTagInput.php new file mode 100644 index 0000000..2d360ac --- /dev/null +++ b/src/Dto/Input/CreateTagInput.php @@ -0,0 +1,25 @@ +