feat: update dagger 0.11.7
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -2,61 +2,63 @@ use dagger_rust::build::{RustVersion, SlimImage};
|
||||
|
||||
#[tokio::main]
|
||||
pub async fn main() -> eyre::Result<()> {
|
||||
let client = dagger_sdk::connect().await?;
|
||||
dagger_sdk::connect(|client| async move {
|
||||
let rust_build = dagger_rust::leptos::LeptosBuild::new(client.clone());
|
||||
|
||||
let rust_build = dagger_rust::leptos::LeptosBuild::new(client.clone());
|
||||
|
||||
let containers = rust_build
|
||||
.build_release(
|
||||
Some("testdata"),
|
||||
RustVersion::Nightly,
|
||||
&["crates/*"],
|
||||
&[
|
||||
"openssl",
|
||||
"libssl-dev",
|
||||
"pkg-config",
|
||||
"musl-tools",
|
||||
"ca-certificates",
|
||||
],
|
||||
vec![SlimImage::Debian {
|
||||
image: "debian:bullseye".into(),
|
||||
deps: vec![
|
||||
"openssl".into(),
|
||||
"libssl-dev".into(),
|
||||
"pkg-config".into(),
|
||||
"musl-tools".into(),
|
||||
"ca-certificates".into(),
|
||||
let containers = rust_build
|
||||
.build_release(
|
||||
Some("testdata"),
|
||||
RustVersion::Nightly,
|
||||
&["crates/*"],
|
||||
&[
|
||||
"openssl",
|
||||
"libssl-dev",
|
||||
"pkg-config",
|
||||
"musl-tools",
|
||||
"ca-certificates",
|
||||
],
|
||||
architecture: dagger_rust::build::BuildArchitecture::Amd64,
|
||||
}],
|
||||
"hackernews_axum",
|
||||
)
|
||||
.await?;
|
||||
vec![SlimImage::Debian {
|
||||
image: "debian:bullseye".into(),
|
||||
deps: vec![
|
||||
"openssl".into(),
|
||||
"libssl-dev".into(),
|
||||
"pkg-config".into(),
|
||||
"musl-tools".into(),
|
||||
"ca-certificates".into(),
|
||||
],
|
||||
architecture: dagger_rust::build::BuildArchitecture::Amd64,
|
||||
}],
|
||||
"hackernews_axum",
|
||||
)
|
||||
.await?;
|
||||
|
||||
let container = containers.first().unwrap();
|
||||
let container = containers.first().unwrap();
|
||||
|
||||
container.directory("/mnt/app").export("output").await?;
|
||||
container.directory("/mnt/app").export("output").await?;
|
||||
|
||||
let tunnel = client.host().tunnel(
|
||||
container
|
||||
.with_env_variable("LEPTOS_SITE_ADDR", "0.0.0.0:8080")
|
||||
.with_exec(vec!["/mnt/app/hackernews_axum"])
|
||||
.as_service(),
|
||||
);
|
||||
let tunnel = client.host().tunnel(
|
||||
container
|
||||
.with_env_variable("LEPTOS_SITE_ADDR", "0.0.0.0:8080")
|
||||
.with_exec(vec!["/mnt/app/hackernews_axum"])
|
||||
.as_service(),
|
||||
);
|
||||
|
||||
tunnel.start().await?;
|
||||
tunnel.start().await?;
|
||||
|
||||
let endpoint = tunnel
|
||||
.endpoint_opts(
|
||||
dagger_sdk::ServiceEndpointOptsBuilder::default()
|
||||
.scheme("http")
|
||||
.build()?,
|
||||
)
|
||||
.await?;
|
||||
let endpoint = tunnel
|
||||
.endpoint_opts(
|
||||
dagger_sdk::ServiceEndpointOptsBuilder::default()
|
||||
.scheme("http")
|
||||
.build()?,
|
||||
)
|
||||
.await?;
|
||||
|
||||
println!("running on: {endpoint}, press enter to stop");
|
||||
println!("running on: {endpoint}, press enter to stop");
|
||||
|
||||
std::io::stdin().read_line(&mut String::new()).unwrap();
|
||||
std::io::stdin().read_line(&mut String::new()).unwrap();
|
||||
|
||||
Ok(())
|
||||
})
|
||||
.await?;
|
||||
Ok(())
|
||||
}
|
||||
|
Reference in New Issue
Block a user