diff --git a/composer-lens/app.py b/composer-lens/app.py new file mode 100644 index 0000000..e69de29 diff --git a/composer-lens/templates/index.html b/composer-lens/templates/index.html new file mode 100644 index 0000000..e69de29 diff --git a/composer/agent.py b/composer/agent.py index 38910a9..961f817 100644 --- a/composer/agent.py +++ b/composer/agent.py @@ -136,7 +136,7 @@ class Composer: """Sets the running status of the compose stack Args: - status: string containing "up", "down", or "restart" corresponding to the respective running state of the composer + status: string containing "up", "down", "restart", or "recreate" corresponding to the respective running state of the composer """ try: @@ -155,6 +155,14 @@ class Composer: self.docker.compose.restart( services=[self.name] ) + elif status == "recreate": + self.docker.compose.up( + build=True, + detach=True, + force_recreate=True, + quiet=True, + remove_orphans=True + ) else: logger.warn(f"Undefined status {status} - use up, down, or restart") except DockerException as error: @@ -241,7 +249,7 @@ class Service: """Sets the running status of the service Args: - status: string containing "up", "down", or "restart" corresponding to the respective running state of the service + status: string containing "up", "down", "restart", or "recreate" corresponding to the respective running state of the service """ try: @@ -261,6 +269,15 @@ class Service: self.parent.docker.compose.restart( services=[self.name] ) + elif status == "recreate": + self.parent.docker.compose.up( + build=True, + detach=True, + force_recreate=True, + quiet=True, + services=[self.name], + remove_orphans=True + ) else: logger.warn(f"Undefined status {status} - use up, down, or restart") except DockerException as error: