mantis-cli 14.0.1__tar.gz → 14.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. {mantis-cli-14.0.1/mantis_cli.egg-info → mantis-cli-14.2.0}/PKG-INFO +1 -1
  2. mantis-cli-14.2.0/mantis/__init__.py +1 -0
  3. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/managers.py +12 -5
  4. {mantis-cli-14.0.1 → mantis-cli-14.2.0/mantis_cli.egg-info}/PKG-INFO +1 -1
  5. mantis-cli-14.0.1/mantis/__init__.py +0 -1
  6. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/.gitignore +0 -0
  7. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/LICENSE +0 -0
  8. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/MANIFEST.in +0 -0
  9. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/README.md +0 -0
  10. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/TODO +0 -0
  11. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/__main__.py +0 -0
  12. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/command_line.py +0 -0
  13. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/crypto.py +0 -0
  14. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/environment.py +0 -0
  15. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/extensions/__init__.py +0 -0
  16. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/extensions/django.py +0 -0
  17. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/extensions/nginx.py +0 -0
  18. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/extensions/postgres.py +0 -0
  19. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/helpers.py +0 -0
  20. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis/logic.py +0 -0
  21. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis_cli.egg-info/SOURCES.txt +0 -0
  22. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis_cli.egg-info/dependency_links.txt +0 -0
  23. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis_cli.egg-info/entry_points.txt +0 -0
  24. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis_cli.egg-info/requires.txt +0 -0
  25. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/mantis_cli.egg-info/top_level.txt +0 -0
  26. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/setup.cfg +0 -0
  27. {mantis-cli-14.0.1 → mantis-cli-14.2.0}/setup.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mantis-cli
3
- Version: 14.0.1
3
+ Version: 14.2.0
4
4
  Summary: Management command to build and deploy webapps, especially based on Django
5
5
  Home-page: https://github.com/PragmaticMates/mantis-cli
6
6
  Author: Erik Telepovský
@@ -0,0 +1 @@
1
+ VERSION = '14.2.0'
@@ -529,6 +529,12 @@ class BaseManager(object):
529
529
  else:
530
530
  CLI.error(f'Unknown build tool: {build_tool}. Available tools: {", ".join(available_tools)}')
531
531
 
532
+ def services(self):
533
+ with open(self.compose_file, 'r') as file:
534
+ compose_data = yaml.safe_load(file)
535
+
536
+ return compose_data.get('services', {}).keys()
537
+
532
538
  def services_to_build(self):
533
539
  with open(self.compose_file, 'r') as file:
534
540
  compose_data = yaml.safe_load(file)
@@ -671,9 +677,10 @@ class BaseManager(object):
671
677
  def remove_suffixes(self, prefix=''):
672
678
  for container in self.get_containers(prefix=prefix):
673
679
  if container.split('-')[-1].isdigit():
674
- CLI.info(f'Removing suffix of container {container}')
675
- new_container = container.rsplit('-', maxsplit=1)[0]
676
- self.docker(f'container rename {container} {new_container}')
680
+ if container not in self.services():
681
+ CLI.info(f'Removing suffix of container {container}')
682
+ new_container = container.rsplit('-', maxsplit=1)[0]
683
+ self.docker(f'container rename {container} {new_container}')
677
684
 
678
685
  def restart_service(self, service):
679
686
  container = self.get_container_name(service)
@@ -757,10 +764,10 @@ class BaseManager(object):
757
764
  CLI.step(index + 1, steps, f'Removing {container}')
758
765
  self.docker(f'container rm {container}')
759
766
 
760
- def clean(self): # todo clean on all nodes
767
+ def clean(self, params=''): # todo clean on all nodes
761
768
  CLI.info('Cleaning...')
762
769
  # self.docker(f'builder prune')
763
- self.docker(f'system prune --volumes --force')
770
+ self.docker(f'system prune {params} -a --force')
764
771
  # self.docker(f'container prune')
765
772
  # self.docker(f'container prune --force')
766
773
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: mantis-cli
3
- Version: 14.0.1
3
+ Version: 14.2.0
4
4
  Summary: Management command to build and deploy webapps, especially based on Django
5
5
  Home-page: https://github.com/PragmaticMates/mantis-cli
6
6
  Author: Erik Telepovský
@@ -1 +0,0 @@
1
- VERSION = '14.0.1'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes