diff --git a/frappe_manager/migration_manager/migration_executor.py b/frappe_manager/migration_manager/migration_executor.py index 953f35e8..1dab8852 100644 --- a/frappe_manager/migration_manager/migration_executor.py +++ b/frappe_manager/migration_manager/migration_executor.py @@ -1,22 +1,15 @@ import shutil import typer -import os import importlib -import configparser import pkgutil from pathlib import Path -import rich - -from rich import inspect -from frappe_manager import CLI_DIR , CLI_SITES_ARCHIVE -from frappe_manager.compose_manager.ComposeFile import ComposeFile +from frappe_manager import CLI_SITES_ARCHIVE from frappe_manager.metadata_manager import MetadataManager from frappe_manager.migration_manager.migration_exections import MigrationExceptionInSite from frappe_manager.utils.helpers import downgrade_package, get_current_fm_version from frappe_manager.logger import log from frappe_manager.migration_manager.version import Version -from frappe_manager.migration_manager.migration_base import MigrationBase from frappe_manager.display_manager.DisplayManager import richprint class MigrationExecutor(): @@ -169,7 +162,7 @@ def execute(self): downgrade_package('frappe-manager',str(self.prev_version.version)) richprint.exit("Rollback complete.") - self.metadata_manager.set_version(self.prev_version) + self.metadata_manager.set_version(self.current_version) self.metadata_manager.save() return True diff --git "a/frappe_manager/migration_manager/migrations/\\" "b/frappe_manager/migration_manager/migrations/\\" deleted file mode 100644 index 73873cee..00000000 --- "a/frappe_manager/migration_manager/migrations/\\" +++ /dev/null @@ -1,61 +0,0 @@ -import shutil -from frappe_manager.migration_manager.migration_base import MigrationBase - -from frappe_manager import CLI_DIR -from frappe_manager.site_manager.SiteManager import SiteManager -#from frappe_manager.display_manager.DisplayManager import richprint - -class MigrationV090(MigrationBase): - - version = "0.9.0" - - def __init__(self): - self.sitesdir = CLI_DIR / "sites" - - def up(self): - if not self.sitesdir.exists(): - - move_directory_list = [] - for site_dir in CLI_DIR.iterdir(): - - if site_dir.is_dir(): - docker_compose_path = site_dir / "docker-compose.yml" - - if docker_compose_path.exists(): - move_directory_list.append(site_dir) - - # stop all the sites - self.sitesdir.mkdir(parents=True, exist_ok=True) - sites_mananger = SiteManager(CLI_DIR) - sites_mananger.stop_sites() - - # move all the directories - for site in move_directory_list: - site_name = site.parts[-1] - new_path = self.sitesdir / site_name - shutil.move(site, new_path) - - def down(self): - - # check if any dirs is available in sites dir - if self.sitesdir.exists(): - move_directory_list = [] - for site_dir in CLI_DIR.iterdir(): - if site_dir.is_dir(): - docker_compose_path = site_dir / "docker-compose.yml" - - if docker_compose_path.exists(): - move_directory_list.append(site_dir) - - # stop all the sites - sites_mananger = SiteManager(CLI_DIR) - sites_mananger.stop_sites() - - # move all the directories - for site in move_directory_list: - site_name = site.parts[-1] - new_path = self.sitesdir.parent / site_name - shutil.move(site, new_path) - - # delete the sitedir - shutil.rmtree(self.sitesdir) diff --git a/frappe_manager/migration_manager/migrations/migrate_0_10_0.py b/frappe_manager/migration_manager/migrations/migrate_0_10_0.py index 60e52110..97d8247e 100644 --- a/frappe_manager/migration_manager/migrations/migrate_0_10_0.py +++ b/frappe_manager/migration_manager/migrations/migrate_0_10_0.py @@ -1,4 +1,3 @@ -from sys import exception from typing import Optional from dataclasses import dataclass import shutil diff --git a/pyproject.toml b/pyproject.toml index 67554faf..e85757f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "frappe-manager" -version = "0.10.0" +version = "0.10.1" license = "MIT" repository = "https://github.com/rtcamp/frappe-manager" description = "A CLI tool based on Docker Compose to easily manage Frappe based projects. As of now, only suitable for development in local machines running on Mac and Linux based OS."