From b4a36b55d6e3df14b4c43cfb10d3945a7a205ed2 Mon Sep 17 00:00:00 2001 From: Benjamin PILIA Date: Mon, 2 Sep 2024 15:01:00 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20de=20la=20v=C3=A9rification=20de=20la?= =?UTF-8?q?=20r=C3=A9ponse=20de=20l'endpoint=20de=20la=20pipeline?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_and_deploy.yml | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build_and_deploy.yml b/.github/workflows/build_and_deploy.yml index 8c05c94..23d6380 100644 --- a/.github/workflows/build_and_deploy.yml +++ b/.github/workflows/build_and_deploy.yml @@ -46,10 +46,17 @@ jobs: steps: - name: Trigger dev deployment run: | - curl --request POST \ - --form token=${{ secrets.GITLAB_CI_TOKEN }} \ - --form ref=main \ - --form "variables[docker_image_tag]=latest" \ - --form "variables[application_to_deploy]=albert-api" \ - --form "variables[deployment_environment]=dev" \ - "https://gitlab.com/api/v4/projects/58117805/trigger/pipeline" + RESPONSE="$(curl --request POST \ + --form token=${{ secrets.GITLAB_CI_TOKEN }} \ + --form ref=main \ + --form 'variables[docker_image_tag]=latest' \ + --form 'variables[application_to_deploy]=albert-api' \ + --form 'variables[deployment_environment]=dev' \ + 'https://gitlab.com/api/v4/projects/58117805/trigger/pipeline')" + + if echo "$RESPONSE" | grep -q '"status":"created"'; then + echo $RESPONSE + else + echo $RESPONSE + exit 1 + fi