les-particules-org/clevercloud/rebuild.sh

17 lines
409 B
Bash
Raw Normal View History

#!/bin/bash -l
if [[ "$INSTANCE_NUMBER" != "0" ]]; then
exit 0
fi
if [[ -z "$REBUILD_API_TOKEN" ]]; then
echo "REBUILD_API_TOKEN non défini" >&2
exit 1
fi
curl -sf -X POST \
"https://api-bridge.clever-cloud.com/v2/organisations/${CC_OWNER_ID}/applications/${APP_ID}/instances" \
-H "Content-Type: application/json" \
-d "{\"token\": \"${REBUILD_API_TOKEN}\"}" \
|| echo "Rebuild failed" >&2