Destroy Flex Interactive instance
(type, container_name, yes)
| 327 | required=False, |
| 328 | ) |
| 329 | def destroy(type, container_name, yes): |
| 330 | """Destroy Flex Interactive instance""" |
| 331 | if yes or click.confirm(f"Do you want to destroy {container_name} instance?"): |
| 332 | cmd = [] |
| 333 | if type == "interactive": |
| 334 | cmd = [ |
| 335 | "docker", |
| 336 | "rm", |
| 337 | "-f", |
| 338 | container_name, |
| 339 | ] |
| 340 | result = subprocess.run(cmd, capture_output=True, text=True) |
| 341 | if result.returncode == 0: |
| 342 | click.secho("[SUCCESS] ", nl=False, fg="green", bold=True) |
| 343 | click.secho(result.stdout, bold=False) |
| 344 | else: |
| 345 | click.secho("[FAILED] ", nl=False, fg="red", bold=True) |
| 346 | click.secho(result.stderr, bold=False) |
| 347 | |
| 348 | |
| 349 | @instance.command |