16
ci/Cargo.toml
Normal file
16
ci/Cargo.toml
Normal file
@@ -0,0 +1,16 @@
|
||||
[package]
|
||||
name = "ci"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
tokio.workspace = true
|
||||
|
||||
dagger-sdk = "0.9.8"
|
||||
eyre = { version = "0.6.12" }
|
||||
|
||||
dagger-components = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
dagger-rust = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
||||
cuddle-ci = { git = "https://git.front.kjuulh.io/kjuulh/dagger-components", branch = "main" }
|
46
ci/src/main.rs
Normal file
46
ci/src/main.rs
Normal file
@@ -0,0 +1,46 @@
|
||||
use cuddle_ci::drone_templater::DroneTemplater;
|
||||
use cuddle_ci::rust_service::architecture::{Architecture, Os};
|
||||
use cuddle_ci::rust_service::{extensions::*, RustService};
|
||||
use cuddle_ci::CuddleCI;
|
||||
|
||||
const BIN_NAME: &str = "cuddle-node-service-plan";
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> eyre::Result<()> {
|
||||
let client = dagger_sdk::connect().await?;
|
||||
|
||||
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",
|
||||
])
|
||||
.with_apt_release(&["git", "openssh-client"])
|
||||
.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-node-service-plan.yaml")
|
||||
.with_variable("bin_name", BIN_NAME)
|
||||
.to_owned();
|
||||
|
||||
CuddleCI::default()
|
||||
.with_pull_request(service)
|
||||
.with_main(service)
|
||||
.with_main(drone_templater)
|
||||
.execute(std::env::args())
|
||||
.await?;
|
||||
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user