Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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