diff --git a/clevercloud/cron.json b/clevercloud/cron.json new file mode 100644 index 0000000..24bec1b --- /dev/null +++ b/clevercloud/cron.json @@ -0,0 +1,3 @@ +[ + "0 23 * * * $ROOT/clevercloud/rebuild.sh" +] diff --git a/clevercloud/rebuild.sh b/clevercloud/rebuild.sh new file mode 100755 index 0000000..4e2475d --- /dev/null +++ b/clevercloud/rebuild.sh @@ -0,0 +1,10 @@ +#!/bin/bash -l + +if [[ "$INSTANCE_NUMBER" != "0" ]]; then + exit 0 +fi + +curl -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}\"}"