first comit

This commit is contained in:
cangui 2024-10-05 16:46:22 +02:00
parent e3ef711383
commit 8e4c000eaa

View File

@ -21,15 +21,17 @@ deploy_to_portainer:
STACK_CREATE=$(curl -s -X POST "$PORTAINER_URL/stacks?type=1&method=string&endpointId=$ENDPOINT_ID" \
-H "Authorization: Bearer $PORTAINER_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"Name\": \"$STACK_NAME\", \"StackFileContent\": \"$(cat docker-compose.yml | sed 's/"/\\"/g' | sed 's/$/\\n/' | tr -d '\n')\", \"Prune\": false}")
-d "{\"Name\": \"$STACK_NAME\", \"StackFileContent\": \"$(cat docker-compose.yml | sed 's/\"/\\\"/g' | sed 's/$/\\n/' | tr -d '\n')\", \"Prune\": false}")
echo "Réponse de création : $STACK_CREATE"
else
echo "La stack existe, mise à jour en cours"
STACK_UPDATE=$(curl -s -X PUT "$PORTAINER_URL/stacks/$STACK_ID?endpointId=$ENDPOINT_ID" \
-H "Authorization: Bearer $PORTAINER_TOKEN" \
-H "Content-Type: application/json" \
-d "{\"StackFileContent\": \"$(cat docker-compose.yml | sed 's/"/\\"/g' | sed 's/$/\\n/' | tr -d '\n')\", \"Prune\": false, \"PullImage\": true}")
-d "{\"StackFileContent\": \"$(cat docker-compose.yml | sed 's/\"/\\\"/g' | sed 's/$/\\n/' | tr -d '\n')\", \"Prune\": false, \"PullImage\": true}")
echo "Réponse de mise à jour : $STACK_UPDATE"
fi
only:
- main
tags:
- docker