예제 #1
0
 def unzip_cache(self):
     logger.info(f'Unzip cache, from {self.cache_libs_path} to {self.generated_path}')
     with step('unzip_prebuild_libs'):
         FileUtils.remove_dir(self.prebuild_path)
         FileUtils.create_dir(self.generated_path)
         FileUtils.copy_file_or_dir(os.path.join(self.cache_path, self.manifest_file), self.prebuild_path)
         # Unzip libs to pod-binary folder
         for zip_path in glob.iglob(os.path.join(self.cache_libs_path, '*.zip')):
             ZipUtils.unzip(zip_path, self.generated_path)
 def unzip_cache(self):
     with step('unzip_prebuild_libs'):
         FileUtils.remove_dir(self.prebuild_path)
         FileUtils.create_dir(self.generated_path)
         FileUtils.copy_file_or_dir(self.cache_path + self.manifest_file,
                                    self.prebuild_path)
         # Unzip libs to pod-binary folder
         for zipPath in glob.iglob(self.cache_libs_path + '/*.zip'):
             ZipUtils.unzip(zipPath, self.generated_path)
 def fetch_cache(self):
     with step('fetch_prebuild_libs'):
         if not os.path.exists(self.cache_path):
             subprocess.run([
                 'git', 'clone', '--depth=1', self.cache_repo,
                 self.cache_path
             ])
         else:
             self.clean_and_pull(self.cache_path)
예제 #4
0
    def fetch_and_apply_devpod_cache(self):
        with step('fetch_and_apply_devpod_cache'):
            logger.info('Fetching devpod cache to {}'.format(self.devpod_cache_path))
            if not os.path.exists(self.devpod_cache_path):
                subprocess.run(['git', 'clone', '--depth=1', self.devpod_cache_repo, self.devpod_cache_path])
            else:
                self.clean_and_pull(self.devpod_cache_path)

            # Unzip devpod libs
            devpod_temp_dir = self.prebuild_path + 'devpod/'
            logger.info('Unzip from: {} to: {}'.format(self.devpod_cache_libs_path, devpod_temp_dir))
            for zip_path in glob.iglob(self.devpod_cache_libs_path + '/*.zip'):
                ZipUtils.unzip(zip_path, devpod_temp_dir)
예제 #5
0
 def fetch_cache(self, branch='master'):
     logger.info(f'Fetch cache to {self.cache_path} (branch: {branch})')
     with step('fetch_prebuild_libs'):
         if os.path.exists(self.cache_path):
             self.clean_and_pull(self.cache_path, branch=branch)
         else:
             subprocess.run([
                 'git',
                 'clone',
                 '--depth=1',
                 f'--branch={branch}',
                 self.cache_repo,
                 self.cache_path
             ])
예제 #6
0
 def push_all_to_git(self, git_dir):
     with step('push to cache from dir: {}'.format(git_dir)):
         git_input_path = 'git -C ' + git_dir
         os.system('{} add .'.format(git_input_path))
         os.system('{} commit -m "Prebuild pod libs"'.format(git_input_path))
         os.system('{} push'.format(git_input_path))