feat: Add platform arg to force building a specific architecture

This commit is contained in:
Gerald Pinder 2024-09-29 17:00:37 -04:00
parent 20d1950530
commit 75eae89e4a
22 changed files with 408 additions and 71 deletions

View file

@ -45,7 +45,10 @@ impl CiDriver for GitlabDriver {
fn generate_tags(opts: &GenerateTagsOpts) -> miette::Result<Vec<String>> {
const MR_EVENT: &str = "merge_request_event";
let os_version = Driver::get_os_version(opts.oci_ref)?;
let os_version = Driver::get_os_version()
.oci_ref(opts.oci_ref)
.platform(opts.platform)
.call()?;
let timestamp = blue_build_utils::get_tag_timestamp();
let short_sha =
get_env_var(CI_COMMIT_SHORT_SHA).inspect(|v| trace!("{CI_COMMIT_SHORT_SHA}={v}"))?;
@ -293,6 +296,7 @@ mod test {
&GenerateTagsOpts::builder()
.oci_ref(&oci_ref)
.maybe_alt_tags(alt_tags)
.platform(crate::drivers::types::Platform::LinuxAmd64)
.build(),
)
.unwrap();