blob: 241a15764fa9eb7ad636730fb874978e74e87a9a [file] [log] [blame]
# Copyright 2025 The ChromiumOS Authors
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Prep everything for for the cros-provision Docker Build Context."""
import sys
sys.path.append("../../../../")
from src.docker_libs.build_libs.shared.common_artifact_prep import ( # noqa: E402 pylint: disable=import-error,wrong-import-position
CrosArtifactPrep,
)
class CrosProvisionArtifactPrepper(CrosArtifactPrep):
"""Prep Needed files for the cros-provision Container Docker Build."""
def __init__(
self,
path: str,
chroot: str,
out_path: str,
sysroot: str,
force_path: bool,
):
"""@param args (ArgumentParser): .chroot, .sysroot, .path."""
super().__init__(
path=path,
chroot=chroot,
out_path=out_path,
sysroot=sysroot,
force_path=force_path,
service="cros-provision",
)
def prep(self):
"""Run the steps needed to prep the container artifacts."""
self.install_cipd_package()
self.cipd_init()
self.cipd_install(
package="chromiumos/infra/cft/provision/cros-provision/linux-amd64",
ref="prod",
json_output_file="cros-provision_cipd_metadata.json",
)
self.copy_metadata()
self.copy_dockercontext()