2023-03-13 20:47:23 +01:00
|
|
|
use dagger_sdk::{QueryContainerOpts, QueryContainerOptsBuilder};
|
2023-03-13 20:44:56 +01:00
|
|
|
|
|
|
|
static PLATFORMS: [&str; 2] = ["linux/arm64", "linux/x86_64"];
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn test_issue_30_alt() -> eyre::Result<()> {
|
|
|
|
let client = dagger_sdk::connect().await?;
|
|
|
|
|
|
|
|
for platform in PLATFORMS {
|
|
|
|
let ref_ = client
|
|
|
|
.container_opts(QueryContainerOpts {
|
|
|
|
id: None,
|
|
|
|
platform: Some(platform.to_string().into()),
|
|
|
|
})
|
|
|
|
.from("alpine")
|
2023-03-13 20:46:53 +01:00
|
|
|
.exit_code()
|
2023-03-13 20:44:56 +01:00
|
|
|
.await?;
|
|
|
|
|
|
|
|
println!("published image to: {:#?}", ref_);
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|
|
|
|
|
|
|
|
#[tokio::test]
|
|
|
|
async fn test_issue_30() -> eyre::Result<()> {
|
|
|
|
let client = dagger_sdk::connect().await?;
|
|
|
|
|
|
|
|
for platform in PLATFORMS {
|
|
|
|
let ref_ = client
|
|
|
|
.container_opts(
|
|
|
|
QueryContainerOptsBuilder::default()
|
|
|
|
.platform(platform)
|
|
|
|
.build()
|
|
|
|
.unwrap(),
|
|
|
|
)
|
|
|
|
.from("alpine")
|
2023-03-13 20:46:53 +01:00
|
|
|
.exit_code()
|
2023-03-13 20:44:56 +01:00
|
|
|
.await?;
|
|
|
|
|
|
|
|
println!("published image to: {:#?}", ref_);
|
|
|
|
}
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|