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