From a28aa46fea14d4e1aa1c2c76650a122b138dd548 Mon Sep 17 00:00:00 2001 From: canguilieme julien Date: Mon, 7 Oct 2024 21:35:43 +0200 Subject: [PATCH] add docker files --- .gitlab-ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 77130de..cbd02bd 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,16 +26,17 @@ deploy-job: - deploiement script: - echo "Déploiement sur Portainer..." + - echo "Utilisation du token API de Portainer..." - | - TOKEN=$(curl -s -X POST -d "{\"Username\":\"$PORTAINER_USERNAME\",\"Password\":\"$PORTAINER_PASSWORD\"}" \ - -H "Content-Type: application/json" http://$PORTAINER_URL/api/auth | jq -r .jwt) + API_KEY="$PORTAINER_API_KEY" - | curl -s -X PUT \ - -H "Authorization: Bearer $TOKEN" \ + -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -d '{"Prune": true}' \ http://$PORTAINER_URL/api/stacks/$STACK_ID/deploy - echo "Déploiement terminé." + dependencies: - build-job - test-job