Skip to content

Instantly share code, notes, and snippets.

@matagus
Created October 9, 2017 18:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matagus/f047d9a0c88b6bd20744369bb9963214 to your computer and use it in GitHub Desktop.
Save matagus/f047d9a0c88b6bd20744369bb9963214 to your computer and use it in GitHub Desktop.
Run a deis command for all your deis apps
import subprocess
import sys
if __name__ == "__main__":
p = subprocess.run(["deis", "apps"], stdout=subprocess.PIPE)
app_list = p.stdout.split()[2:]
cmd = ["deis"] + sys.argv[1:]
for app in app_list:
p = subprocess.run(cmd + ["-a", app.decode("utf-8")], stdout=subprocess.PIPE, universal_newlines=True)
print(p.stdout)
print()

Usage

# run deis ps -a <app name> for each app
deis-multiplexer.py ps

# run deis limits -a <app name> for each app
deis-multiplexer.py limits

# BE CAREFULL: run deis ps:restart -a <app name> for each app
deis-multiplexer.py ps:restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment