Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
56c01088b8
commit
e9abbfb266
617
Cargo.lock
generated
617
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
|
|
||||||
dagger-sdk = "0.9.8"
|
dagger-sdk = "0.11.10"
|
||||||
eyre = { version = "0.6.12" }
|
eyre = { version = "0.6.12" }
|
||||||
|
|
||||||
dagger-components = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
dagger-components = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||||
|
@ -10,41 +10,44 @@ const BIN_NAME: &str = "cuddle-rust-service-plan";
|
|||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() -> eyre::Result<()> {
|
async fn main() -> eyre::Result<()> {
|
||||||
let client = dagger_sdk::connect().await?;
|
dagger_sdk::connect(|client| async move {
|
||||||
|
let service = &RustService::from(client.clone())
|
||||||
|
.with_arch(Architecture::Amd64)
|
||||||
|
.with_os(Os::Linux)
|
||||||
|
.with_apt(&[
|
||||||
|
"clang",
|
||||||
|
"libssl-dev",
|
||||||
|
"libz-dev",
|
||||||
|
"libgit2-dev",
|
||||||
|
"git",
|
||||||
|
"openssh-client",
|
||||||
|
"protobuf-compiler",
|
||||||
|
])
|
||||||
|
.with_apt_release(&["git", "openssh-client", "protobuf-compiler"])
|
||||||
|
.with_docker_cli()
|
||||||
|
.with_cuddle_cli()
|
||||||
|
.with_kubectl()
|
||||||
|
.with_apt_ca_certificates()
|
||||||
|
.with_crates(["ci", "crates/*"])
|
||||||
|
.with_mold("2.3.3")
|
||||||
|
.with_bin_name(BIN_NAME)
|
||||||
|
.with_deployment(false)
|
||||||
|
.to_owned();
|
||||||
|
|
||||||
let service = &RustService::from(client.clone())
|
let drone_templater =
|
||||||
.with_arch(Architecture::Amd64)
|
&DroneTemplater::new(client, "templates/cuddle-rust-service-plan.yaml")
|
||||||
.with_os(Os::Linux)
|
.with_variable("bin_name", BIN_NAME)
|
||||||
.with_apt(&[
|
.to_owned();
|
||||||
"clang",
|
|
||||||
"libssl-dev",
|
|
||||||
"libz-dev",
|
|
||||||
"libgit2-dev",
|
|
||||||
"git",
|
|
||||||
"openssh-client",
|
|
||||||
"protobuf-compiler",
|
|
||||||
])
|
|
||||||
.with_apt_release(&["git", "openssh-client", "protobuf-compiler"])
|
|
||||||
.with_docker_cli()
|
|
||||||
.with_cuddle_cli()
|
|
||||||
.with_kubectl()
|
|
||||||
.with_apt_ca_certificates()
|
|
||||||
.with_crates(["ci", "crates/*"])
|
|
||||||
.with_mold("2.3.3")
|
|
||||||
.with_bin_name(BIN_NAME)
|
|
||||||
.with_deployment(false)
|
|
||||||
.to_owned();
|
|
||||||
|
|
||||||
let drone_templater = &DroneTemplater::new(client, "templates/cuddle-rust-service-plan.yaml")
|
CuddleCI::default()
|
||||||
.with_variable("bin_name", BIN_NAME)
|
.with_pull_request(service)
|
||||||
.to_owned();
|
.with_main(service)
|
||||||
|
.with_main(drone_templater)
|
||||||
CuddleCI::default()
|
.execute(std::env::args())
|
||||||
.with_pull_request(service)
|
.await?;
|
||||||
.with_main(service)
|
Ok(())
|
||||||
.with_main(drone_templater)
|
})
|
||||||
.execute(std::env::args())
|
.await?;
|
||||||
.await?;
|
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@ edition = "2021"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
tokio.workspace = true
|
tokio.workspace = true
|
||||||
|
|
||||||
dagger-sdk = "0.9.8"
|
dagger-sdk = "0.11.10"
|
||||||
eyre = { version = "0.6.12" }
|
eyre = { version = "0.6.12" }
|
||||||
|
|
||||||
tracing.workspace = true
|
tracing.workspace = true
|
||||||
|
@ -21,43 +21,47 @@ use cuddle_clusters::IntoComponent;
|
|||||||
async fn main() -> eyre::Result<()> {
|
async fn main() -> eyre::Result<()> {
|
||||||
tracing_subscriber::fmt::init();
|
tracing_subscriber::fmt::init();
|
||||||
|
|
||||||
let client = dagger_sdk::connect().await?;
|
dagger_sdk::connect(|client| async move {
|
||||||
let cuddle_file = CuddleFile::from_cuddle_file().await?;
|
let cuddle_file = CuddleFile::from_cuddle_file().await?;
|
||||||
|
|
||||||
let service = &RustService::from(client.clone())
|
let service = &RustService::from(client.clone())
|
||||||
.with_cuddle_file(&cuddle_file)
|
.with_cuddle_file(&cuddle_file)
|
||||||
.with_arch(Architecture::Amd64)
|
.with_arch(Architecture::Amd64)
|
||||||
.with_os(Os::Linux)
|
.with_os(Os::Linux)
|
||||||
.with_apt(&["libssl-dev", "libz-dev", "libpq-dev", "protobuf-compiler"])
|
.with_apt(&["libssl-dev", "libz-dev", "libpq-dev", "protobuf-compiler"])
|
||||||
.with_apt_release(&["libssl-dev", "libz-dev", "libpq-dev"])
|
.with_apt_release(&["libssl-dev", "libz-dev", "libpq-dev"])
|
||||||
.with_apt_ca_certificates()
|
.with_apt_ca_certificates()
|
||||||
.with_workspace_crates()
|
.with_workspace_crates()
|
||||||
.await
|
.await
|
||||||
.with_mold("2.3.3")
|
.with_mold("2.3.3")
|
||||||
.to_owned();
|
.to_owned();
|
||||||
|
|
||||||
let render = &RustServiceRender {
|
let render = &RustServiceRender {
|
||||||
service: cuddle_file.vars.service,
|
service: cuddle_file.vars.service,
|
||||||
//registry: "http://127.0.0.1:7900".into(),
|
//registry: "http://127.0.0.1:7900".into(),
|
||||||
//registry: "http://10.0.11.19:7900".into(),
|
//registry: "http://10.0.11.19:7900".into(),
|
||||||
registry: "https://releaser.i.kjuulh.io".into(),
|
registry: "https://releaser.i.kjuulh.io".into(),
|
||||||
};
|
};
|
||||||
let deployment = &CuddleReleaser::new(client.clone()).await?;
|
let deployment = &CuddleReleaser::new(client.clone()).await?;
|
||||||
|
|
||||||
let mut ci = CuddleCI::default();
|
let mut ci = CuddleCI::default();
|
||||||
|
|
||||||
ci.with_pull_request(service)
|
ci.with_pull_request(service)
|
||||||
.with_pull_request(render)
|
.with_pull_request(render)
|
||||||
//.with_pull_request(deployment.clone())
|
//.with_pull_request(deployment.clone())
|
||||||
.with_main(service)
|
.with_main(service)
|
||||||
.with_main(render)
|
.with_main(render)
|
||||||
.with_main(deployment);
|
.with_main(deployment);
|
||||||
|
|
||||||
if cuddle_file.please.is_some() {
|
if cuddle_file.please.is_some() {
|
||||||
ci.with_main(&CuddlePlease::new(client.clone()));
|
ci.with_main(&CuddlePlease::new(client.clone()));
|
||||||
}
|
}
|
||||||
|
|
||||||
ci.execute(std::env::args()).await?;
|
ci.execute(std::env::args()).await?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
})
|
||||||
|
.await?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user