From 756fc23cfece0295cd5cf69733fd5dba3a87c98b Mon Sep 17 00:00:00 2001 From: canguilieme julien Date: Mon, 7 Oct 2024 22:14:23 +0200 Subject: [PATCH] add docker files --- .gitlab-ci.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index fa8fa2c..26ba77f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -38,10 +38,15 @@ deploy-job: echo "Déclenchement du redeploiement de la stack Git sur Portainer..." + # Construire le corps de la requête JSON + DATA="{\"endpointId\": $ENDPOINT_ID}" + # Exécuter la requête pour redeployer la stack Git - RESPONSE=$(curl -s -k -w "%{http_code}" -X POST \ + RESPONSE=$(curl -s -k -w "%{http_code}" -X PUT \ -H "Authorization: Bearer $PORTAINER_API_KEY" \ - "https://$PORTAINER_URL/api/stacks/$STACK_ID/git/redeploy?endpointId=$ENDPOINT_ID") + -H "Content-Type: application/json" \ + -d "$DATA" \ + "https://$PORTAINER_URL/api/stacks/$STACK_ID/git/redeploy") # Extraire le code HTTP de la réponse HTTP_CODE="${RESPONSE: -3}" @@ -54,3 +59,4 @@ deploy-job: fi echo "Déploiement terminé avec succès." +