From f03e350e48dbe704a03e8d0982269df123503d24 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Wed, 3 Sep 2025 08:30:19 +0200 Subject: [PATCH 1/2] refs #2508. Force push git option --- src/Controller/UpdateGitImageAction.php | 1 + src/Dto/Input/UpdateGitImageInput.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Controller/UpdateGitImageAction.php b/src/Controller/UpdateGitImageAction.php index b8a8e87..46169f8 100644 --- a/src/Controller/UpdateGitImageAction.php +++ b/src/Controller/UpdateGitImageAction.php @@ -84,6 +84,7 @@ class UpdateGitImageAction extends AbstractController 'diskNumber' => $partition->getDiskNumber(), 'partitionNumber' => $partition->getPartitionNumber(), 'repositoryName' => $input->gitRepository, + 'options' => $input->options ? 'force push' : null, ]; } } \ No newline at end of file diff --git a/src/Dto/Input/UpdateGitImageInput.php b/src/Dto/Input/UpdateGitImageInput.php index 7641cf4..8cc841d 100644 --- a/src/Dto/Input/UpdateGitImageInput.php +++ b/src/Dto/Input/UpdateGitImageInput.php @@ -32,6 +32,10 @@ class UpdateGitImageInput public ?string $destinationBranch = null; #[Groups(['git-repository:write'])] - #[ApiProperty(description: 'Whether to queue the update', example: false)] + #[ApiProperty(description: 'Whether to push the image to the Git repository', example: false)] + public ?bool $options = null; + + #[Groups(['git-repository:write'])] + #[ApiProperty(description: 'Whether to queue the update for later', example: false)] public bool $queue = false; } \ No newline at end of file From efe4f601c4e8d6558e5405341f48cf4219d681a6 Mon Sep 17 00:00:00 2001 From: Manuel Aranda Date: Wed, 3 Sep 2025 10:45:48 +0200 Subject: [PATCH 2/2] Fixed typo. Added new jenkinsfile info --- CHANGELOG.md | 8 ++++++++ Jenkins/Jenkinsfile-deb-pkg | 15 ++++++++++++++- src/Controller/DeployImageAction.php | 9 +++------ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1315b60..a0d743e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,12 @@ # Changelog +## [0.22.1] - 2025-09-03 +### Fixed +- Se ha corregido un typo. + +### Improved +- Se ha aƱadido nueva configuracion a Jenkinsfile para la ejecucion de los test automaticos. + +--- ## [0.22.0] - 2025-09-03 ### Added - Se han mejorado el control de errores respecto a ogRepository diff --git a/Jenkins/Jenkinsfile-deb-pkg b/Jenkins/Jenkinsfile-deb-pkg index 0f9cea7..2b4384a 100644 --- a/Jenkins/Jenkinsfile-deb-pkg +++ b/Jenkins/Jenkinsfile-deb-pkg @@ -98,8 +98,21 @@ pipeline { } } post { + success { + script { + // Solo lanzar cuando el build sea exitoso y en la rama main + if (env.BRANCH_NAME == 'main') { + build job: 'Aptly publish nightly repository', + wait: false, + parameters: [ + string(name: 'TRIGGERED_BY', value: "${env.JOB_NAME}-${env.BUILD_NUMBER}") + ] + } + } + + } always { - notifyBuildStatus('narenas@qindel.com') + notifyBuildStatus('opengnsys@qindel.com') } } } diff --git a/src/Controller/DeployImageAction.php b/src/Controller/DeployImageAction.php index 5e6d798..8dbda7a 100644 --- a/src/Controller/DeployImageAction.php +++ b/src/Controller/DeployImageAction.php @@ -6,12 +6,8 @@ namespace App\Controller; use ApiPlatform\Validator\ValidatorInterface; use App\Dto\Input\DeployImageInput; -use App\Entity\Command; -use App\Entity\Image; -use App\Model\ClientStatus; +use App\Model\ImageStatus; use App\Entity\ImageImageRepository; -use App\Entity\OrganizationalUnit; -use App\Entity\Partition; use App\Model\CommandTypes; use App\Model\DeployMethodTypes; use App\Model\TraceStatus; @@ -25,6 +21,7 @@ use Symfony\Contracts\HttpClient\Exception\ClientExceptionInterface; use Symfony\Contracts\HttpClient\Exception\RedirectionExceptionInterface; use Symfony\Contracts\HttpClient\Exception\ServerExceptionInterface; use Symfony\Contracts\HttpClient\HttpClientInterface; +use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; class DeployImageAction extends AbstractController { @@ -46,7 +43,7 @@ class DeployImageAction extends AbstractController public function __invoke(DeployImageInput $input, ImageImageRepository $image): JsonResponse { if ($image->getStatus() !== ImageStatus::SUCCESS) { - return new BadRequestHttpException('Image is not ready to be deployed'); + throw new BadRequestHttpException('Image is not ready to be deployed'); } $this->validator->validate($input);