#!/usr/bin/env python3 # -*- coding: utf-8 -*- import argparse import logging import utilities def run_docker_service_update(stack, service): utilities.run_command(["docker", "service", "update", "--force", stack + "_" + service]) if __name__ == "__main__": parser = argparse.ArgumentParser(description="Update a service for all the stacks") parser.add_argument("-s", "--service", choices=["tripal", "galaxy", "jbrowse", "tripal-db", "elasticsearch", "proxy"], help="Service to update") parser.add_argument("-v", "--verbose", help="Increase output verbosity", action="store_true") args = parser.parse_args() service = args.service if args.verbose: logging.basicConfig(level=logging.DEBUG) logging.debug("Debug mode") else: logging.basicConfig(level=logging.INFO) stacks = utilities.run_docker_stack_ls() # Stop the Galaxy services for stack in stacks: if stack not in ["traefik", "portainer"]: run_docker_service_update( stack=stack, service=service )