예제 #1
0
 def execute(self):
     self.journal.section('Finalise Package')
     build_tree = self.__create_pkg_build_tree()
     files.clean_directory(build_tree.root_path)
     pkg_meta_file_path = build_tree.pkg_meta_file_path()
     self.__create_pkg_meta(pkg_meta_file_path)
     pkg_path = build_tree.gen_pkg_path(
         self.project.config.full_name,
         self.project.config.version,
         packaging=self.project.config.packaging)
     self.journal.event('Creating package at: {0}'.format(pkg_path))
     pkg_tree = pkgs.ExpandedPkgTree()
     compiled_content_path = self.content_tree.root_path
     if self.project.config.packaging == CSAR_PACKAGING:
         with zipfile.ZipFile(pkg_path, mode='w') as pkg_zip:
             self.__build_package(pkg_zip.write, pkg_tree,
                                  compiled_content_path, pkg_meta_file_path)
     else:
         with tarfile.open(pkg_path, mode='w:gz') as pkg_tar:
             self.__build_package(pkg_tar.add, pkg_tree,
                                  compiled_content_path, pkg_meta_file_path)
     self.__clear_compile_directory()
     try:
         return pkgs.Pkg(pkg_path)
     except pkgs.InvalidPackageError as e:
         raise PkgProcessError(str(e)) from e
예제 #2
0
파일: core.py 프로젝트: rajahaidar/lmctl
 def push(self, env_sessions, options):
     journal = self.__init_journal(options.journal_consumer)
     journal.section('Processing Package')
     journal.event('Processing {0}'.format(self.path))
     push_workspace = self.__create_push_workspace()
     files.clean_directory(push_workspace)
     pkg_content = self.open(push_workspace)
     pkg_content.push(env_sessions, options)
     return pkg_content
예제 #3
0
파일: core.py 프로젝트: IBM/lmctl
    def push(self, env_sessions, options):
        journal = self.__init_journal(options.journal_consumer)
        journal.section('Processing Package')
        journal.event('Processing {0}'.format(self.path))

        push_workspace = self.__create_push_workspace()
        files.clean_directory(push_workspace)
        pkg_content = self.open(push_workspace)

        if self.__is_etsi_pkg(pkg_content.meta):
            etsi_push_exec.EtsiPushProcess(self, pkg_content.meta, journal,
                                           env_sessions,
                                           push_workspace).execute()
        else:
            pkg_content.push(env_sessions, options)
        return pkg_content
예제 #4
0
파일: compile.py 프로젝트: rajahaidar/lmctl
 def __prepare_compile_directories(self):
     files.clean_directory(self.content_tree.root_path)
예제 #5
0
파일: staging.py 프로젝트: IBM/lmctl
 def __prepare_stage_directories(self):
     files.clean_directory(self.staging_tree.root_path)