| # Copyright 2022 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-fw-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 CrosFWProvisionArtifactPrep(CrosArtifactPrep): |
| """Prep Needed files for the cros-fw-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-fw-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-fw-provision/linux-amd64", |
| ref="prod", |
| json_output_file="cros-fw-provision_cipd_metadata.json", |
| ) |
| self.copy_metadata() |
| self.copy_dockercontext() |