Skip to content

Commit

Permalink
Merge pull request #147 from rtCamp/fix/services-creation
Browse files Browse the repository at this point in the history
fix: remove containers when creating services
  • Loading branch information
Xieyt authored Apr 21, 2024
2 parents d706a9e + 04a8646 commit ce747d3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion frappe_manager/services_manager/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def init(self):

self.docker = DockerClient(compose_file_path=self.composefile.compose_path)

def create(self, backup=False):
def create(self, backup: bool = False,clean_install: bool = True):
envs = {
"global-db": {
"MYSQL_ROOT_PASSWORD_FILE": '/run/secrets/db_root_password',
Expand Down Expand Up @@ -189,6 +189,10 @@ def create(self, backup=False):
self.composefile.set_secret_file_path('db_root_password',str(db_root_password_path.absolute()))
self.composefile.write_to_file()

if clean_install:
# remove previous contaniners and volumes
self.docker.compose.down(remove_orphans=True,timeout=1,volumes=True,stream=True, stream_only_exit_code=True)

def get_database_info(self):
"""
Provides info about databse
Expand Down

0 comments on commit ce747d3

Please sign in to comment.