Testing: Modules Updates

Signed-off-by: debianpepper <pdpdebdevuan@protonmail.com>
This commit is contained in:
debianpepper 2023-12-13 19:19:08 +09:00
parent 36b6ba5c46
commit a46dff6e76
1 changed files with 42 additions and 146 deletions

View File

@ -39,54 +39,67 @@ START_LIVEBUILD = "Start Live-Build Process"
BUILD_COMPILED = "ISO build has compiled successfully"
BUILD_COMPLETED = "ISO is ready for usage. Begin copy to Nightly for QA testing"
class BuildXfce:
class BuildBase:
"""
Determine what base to use and then build the ISO
Base class for building ISOs.
"""
def __init__(self, sbase, sarch):
""" init the build process"""
def __init__(self, sbase, sarch, desktop_helper):
self.sbase = sbase
self.sarch = sarch
self.change_to_fusato_root_and_build()
self.change_to_fusato_root_and_build(desktop_helper)
def change_to_fusato_root_and_build(self):
""" change to the correct folder for the build """
def change_to_fusato_root_and_build(self, desktop_helper):
os.chdir(HOME_FOLDER + FUSATO_ROOT)
self.build_system()
self.build_system(desktop_helper)
def lb_helper(self):
"""
Helper for the lb setup this is shared for all builds
"""
lbsetup = None
if self.sbase in ["deb", "dev"]:
arch_suffix = self.sarch[1:]
if arch_suffix in ["64", "32", "arm"]:
lbsetup = getattr(conf,
f"LBSET_{self.sbase.upper()}{arch_suffix}"
)
lbsetup = getattr(conf, f"LBSET_{self.sbase.upper()}{arch_suffix}")
os.system(lbsetup)
return lbsetup
def infra_helper(self):
"""
Helper for the infra classes this is shared for all builds
"""
infra_methods = [infra.ChrootFolders, infra.BinaryFolders,
infra.ArchitectureFiles, infra.Archive
]
infra_methods = [infra.ChrootFolders, infra.BinaryFolders, infra.ArchitectureFiles, infra.Archive]
for method in infra_methods:
method(self.sbase, self.sarch)
def cleanup_helper(self):
finish_cleanup.make_check_sum()
finish_cleanup.check_build_type()
finish_cleanup.kill_old_iso()
def build_system(self, desktop_helper):
current_working_directory = os.getcwd()
dir_current = WRKING_DIR + current_working_directory
logger.info(f"Building a {self.sbase}{self.sarch[1:]} bit ISO")
logger.info(dir_current)
self.lb_helper()
desktop_helper()
self.infra_helper()
logger.info(CFG_READY)
logger.info(START_LIVEBUILD)
logger.info(dir_current)
self.lb_helper()
run_cmd = 'sudo lb build'
os.chdir(HOME_FOLDER + FUSATO_ROOT)
desktop_name = desktop_helper.__name__.split('_')[-1]
inflate_bubble.make_bld(self.sbase, self.sarch[1:], desktop_name)
logger.info(dir_current)
os.system(run_cmd)
logger.info(BUILD_COMPLETED)
logger.info(dir_current)
self.cleanup_helper()
logger.info(BUILD_COMPLETED)
class BuildXfce(BuildBase):
def __init__(self, sbase, sarch):
super().__init__(sbase, sarch, self.xfce_helper)
def xfce_helper(self):
"""
Helper for the xfce desktop shared for all builds
"""
arch_suffix = self.sarch[1:]
cmd_list = None
if arch_suffix in ["64", "32", "arm"]:
@ -96,91 +109,11 @@ class BuildXfce:
exec(execute)
return cmd_list
def cleanup_helper(self):
""" Clean up Helper to move the ISOs to the nightly location """
finish_cleanup.make_check_sum()
finish_cleanup.check_build_type()
finish_cleanup.kill_old_iso()
def build_system(self):
""" Builds the ISO XFCE Depedning on the Arch """
current_working_directory = os.getcwd()
dir_current = WRKING_DIR + current_working_directory
logger.info("Building a " + self.sbase + self.sarch[1:] + " bit ISO")
logger.info(dir_current)
# Set the config tree
self.lb_helper()
# Start with the XFCE stuff
self.xfce_helper()
# Run the specific classes
self.infra_helper()
# Run the Build
logger.info(CFG_READY)
logger.info(START_LIVEBUILD)
logger.info(dir_current)
self.lb_helper()
run_cmd = 'sudo lb build'
current_working_directory = os.getcwd()
os.chdir(HOME_FOLDER + FUSATO_ROOT)
# Set the build inidcator
inflate_bubble.make_bld_xfce(self.sbase, self.sarch[1:])
logger.info(dir_current)
os.system(run_cmd)
logger.info(BUILD_COMPILED)
logger.info(dir_current)
self.cleanup_helper()
logger.info(BUILD_COMPLETED)
class BuildGflashback:
"""
Determine what base to use and then build the ISO
"""
class BuildGflashback(BuildBase):
def __init__(self, sbase, sarch):
""" init the build process"""
self.sbase = sbase
self.sarch = sarch
self.change_to_fusato_root_and_build()
def change_to_fusato_root_and_build(self):
""" change to the correct folder for the build """
os.chdir(HOME_FOLDER + FUSATO_ROOT)
self.build_system()
def lb_helper(self):
"""
Helper for the lb setup this is shared for all builds
"""
lbsetup = None
if self.sbase in ["deb", "dev"]:
arch_suffix = self.sarch[1:]
if arch_suffix in ["64", "32", "arm"]:
lbsetup = getattr(conf,
f"LBSET_{self.sbase.upper()}{arch_suffix}"
)
os.system(lbsetup)
return lbsetup
def infra_helper(self):
"""
Helper for the infra classes this is shared for all builds
"""
infra_methods = [infra.ChrootFolders, infra.BinaryFolders,
infra.ArchitectureFiles, infra.Archive
]
for method in infra_methods:
method(self.sbase, self.sarch)
super().__init__(sbase, sarch, self.gfb_helper)
def gfb_helper(self):
"""
Helper for the gfb desktop shared for all builds
"""
arch_suffix = self.sarch[1:]
cmd_list = None
if arch_suffix in ["64", "32", "arm"]:
@ -191,43 +124,6 @@ class BuildGflashback:
return cmd_list
def cleanup_helper(self):
""" Clean up Helper to move the ISOs to the nightly location """
finish_cleanup.make_check_sum()
finish_cleanup.check_build_type()
finish_cleanup.kill_old_iso()
def build_system(self):
""" Builds the ISO GFB Depedning on the Arch """
current_working_directory = os.getcwd()
dir_current = WRKING_DIR + current_working_directory
logger.info("Building a " + self.sbase + self.sarch[1:] + " bit ISO")
logger.info(dir_current)
# Set the config tree
self.lb_helper()
# Start with the XFCE stuff
self.gfb_helper()
# Run the specific classes
self.infra_helper()
# Run the Build
logger.info(CFG_READY)
logger.info(START_LIVEBUILD)
logger.info(dir_current)
self.lb_helper()
run_cmd = 'sudo lb build'
current_working_directory = os.getcwd()
os.chdir(HOME_FOLDER + FUSATO_ROOT)
# Set the build inidcator
inflate_bubble.make_bld_gnomeflashback(self.sbase, self.sarch[1:])
logger.info(dir_current)
os.system(run_cmd)
logger.info(BUILD_COMPLETED)
logger.info(dir_current)
self.cleanup_helper()
logger.info(BUILD_COMPLETED)
def readybuild():
"""" Make Ready the bld structure If fusato exists remove it.
and recreate it, otherwise just make a new folder named