https://github.com/openjournals/whedon-api
Raw File
Tip revision: dbb71d6cf4f96b4a72ab1eb6d9ba2c794367368a authored by Juanjo Bazán on 09 March 2023, 09:19:20 UTC
Merge pull request #152 from openjournals/dependabot/bundler/rack-2.1.4.3
Tip revision: dbb71d6
restart.sh
#!/bin/sh

# Set up the Heroku scheduler to run this command every hour. See example setup at https://goo.gl/nMCSH3
#
# Requires env vars to be set in Heroku with `heroku config:set`:
#  - HEROKU_APP_NAME:  this is just the app name in Heroku, i.e. `heroku apps` will list all apps you have access to
#  - HEROKU_CLI_USER:  Once Heroku CLI is authenticated (https://goo.gl/Qypr4x), check `cat .netrc` (or `_netrc` on Windows),
#                      look for `login` under `machine api.heroku.com`
#  - HEROKU_CLI_TOKEN: As above, but use the `password` field
#
# It helps if this file has execute privileges `chmod +x restart.sh`
#
# Test this script works by running `heroku run "~/restart.sh"`
#
# Heroku API: Restart all Dynos, see https://devcenter.heroku.com/articles/platform-api-reference#dyno-restart-all
curl -X DELETE "https://api.heroku.com/apps/${HEROKU_APP_NAME}/dynos" \
     --user "${HEROKU_CLI_USER}:${HEROKU_CLI_TOKEN}" \
     -H "Content-Type: application/json" \
     -H "Accept: application/vnd.heroku+json; version=3"
back to top