first comit
This commit is contained in:
parent
e3ef711383
commit
8e4c000eaa
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user