Created
February 26, 2020 12:13
-
-
Save raldred/e5f3bad6be15188e6262151976378766 to your computer and use it in GitHub Desktop.
Quick script to check the stack of all our apps
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
team = ARGV[0] | |
raise 'Specify team' unless team | |
check_app = Proc.new do |app| | |
info = %x{heroku apps:info -a #{app}} | |
stack = info.match(/Stack:\s+(.*)/)[1].strip | |
app = "#{app}:" | |
puts "#{app.ljust(30)} #{stack}" | |
end | |
check_app.call(ARGV[0]) && return if ARGV[0] | |
def all_apps(team) | |
apps = %x{heroku apps -t #{team}} | |
apps.scan(/^([\w-]+)/).flatten | |
end | |
apps = all_apps(team) | |
apps.each(&check_app) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment