feat(sdk): with return result instead of unwrap

This commit is contained in:
2023-02-19 15:18:25 +01:00
committed by Kasper Juul Hermansen
parent 5d66736990
commit de063eae85
10 changed files with 116 additions and 98 deletions

View File

@@ -12,12 +12,12 @@ fn main() -> eyre::Result<()> {
}),
);
let node_cache = client.cache_volume("node".into()).id();
let node_cache = client.cache_volume("node".into()).id()?;
let source = client
.container(None)
.from("node:16".into())
.with_mounted_directory("/src".into(), host_source_dir.id())
.with_mounted_directory("/src".into(), host_source_dir.id()?)
.with_mounted_cache("/src/node_modules".into(), node_cache, None);
let runner = source
@@ -43,11 +43,11 @@ fn main() -> eyre::Result<()> {
let ref_ = client
.container(None)
.from("nginx".into())
.with_directory("/usr/share/nginx/html".into(), build_dir.id(), None)
.with_directory("/usr/share/nginx/html".into(), build_dir.id()?, None)
.publish(
format!("ttl.sh/hello-dagger-rs-{}:1h", rng.gen::<u64>()),
None,
);
)?;
println!("published image to: {}", ref_);