Ejemplo n.º 1
0
def BundleImageArchives(input_proto, output_proto, _config):
  """Create a .tar.xz archive for each image that has been created."""
  build_target = controller_util.ParseBuildTarget(input_proto.build_target)
  output_dir = input_proto.output_dir
  image_dir = _GetImageDir(constants.SOURCE_ROOT, build_target.name)
  if image_dir is None:
    return

  archives = artifacts.ArchiveImages(image_dir, output_dir)

  for archive in archives:
    output_proto.artifacts.add().path = os.path.join(output_dir, archive)
Ejemplo n.º 2
0
 def testAllImages(self):
     """Test each image gets picked up."""
     created = artifacts.ArchiveImages(self.image_dir, self.output_dir)
     self.assertCountEqual(list(artifacts.IMAGE_TARS.values()), created)
Ejemplo n.º 3
0
 def testNoImages(self):
     """Test an empty directory handling."""
     artifacts.ArchiveImages(self.tempdir, self.output_dir)
     self.assertFalse(os.listdir(self.output_dir))