class Shred::Commands::Heroku

Public Instance Methods

connection() click to toggle source
# File lib/shred/commands/heroku.rb, line 22
def connection
  @connection ||= begin
    ::Dotenv.load
    begin
      PlatformAPI.connect_oauth(ENV['HEROKU_DEPLOY_TOKEN'])
    rescue Excon::Errors::Unauthorized
      console.say_err("Access to Heroku is not authorized. Did you set the HEROKU_DEPLOY_TOKEN environment variable?")
      exit(1)
    end
  end
end
restartall(environment) click to toggle source
# File lib/shred/commands/heroku.rb, line 15
def restartall(environment)
  app_name = cfg("#{environment}.app_name")
  connection.dyno.restart_all(app_name)
  console.say_ok("Restarted all dynos for #{app_name}")
end