38 Commits
v0.3.0 ... main

Author SHA1 Message Date
e26e359d10 feat: upgrade to dagger 1.18.3 2025-07-21 17:17:19 +02:00
2e714767a1 feat: update dagger 2025-03-25 22:58:25 +01:00
dfc4602eee chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-28 01:35:01 +00:00
14f9f5e317 chore(deps): update rust crate serde to v1.0.218
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-27 05:32:16 +00:00
e1b74380ed fix(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-27 01:35:53 +00:00
c79cc1da81 chore(deps): update all dependencies
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2025-02-20 05:32:45 +00:00
8ee0c408ef chore(deps): update rust crate clap to v4.5.30
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2025-02-18 01:33:59 +00:00
e1187b326b chore(deps): update rust crate dagger-sdk to v0.15.4
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2025-02-13 01:32:19 +00:00
6c04623646 chore(deps): update rust crate clap to v4.5.29
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-12 01:35:29 +00:00
f7676fa5c3 fix(deps): update rust crate toml to v0.8.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-06 01:32:56 +00:00
35bc853548 chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-02-04 01:33:38 +00:00
15d8fe22b6 chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-29 01:34:35 +00:00
2c6ca7521d chore(deps): update rust crate serde_json to v1.0.137
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-20 01:31:02 +00:00
b641feac89 chore(deps): update rust crate serde_json to v1.0.136
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-19 01:32:26 +00:00
855b8c0edc chore(deps): update rust crate dagger-sdk to v0.15.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-15 01:36:27 +00:00
11326924bb chore(deps): update rust crate clap to v4.5.26
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2025-01-10 01:27:26 +00:00
63ed60d607 chore: update cuddle please
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-10 00:22:48 +01:00
7ea8af6b44 chore: update cuddle please to include commit history in changelog
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-09 23:49:37 +01:00
0cc95dfc14 chore(deps): update rust crate tokio to v1.43.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-09 01:29:24 +00:00
f30d49cb14 chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-08 01:27:10 +00:00
69b27ceb42 chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-07 01:28:46 +00:00
f2fdcdcaa0 chore(deps): update rust crate serde to v1.0.217
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-28 01:30:45 +00:00
838d0c606a fix: cuddle file test
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-12-27 17:00:34 +01:00
68464938a3 feat: add option
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-12-27 16:30:02 +01:00
7c9890a8d5 feat: use publish tag instead of bool
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-12-27 16:27:42 +01:00
80a34851a6 feat: add publish
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-12-27 16:19:43 +01:00
2e43b9b723 feat: update cuddle file
Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-12-27 16:18:19 +01:00
e1a2d03fbe feat: add release action
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-12-27 15:58:57 +01:00
2d48b523c3 fix: release action like main and pr
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-12-22 12:24:27 +01:00
b1358a7e5e chore(deps): update rust crate serde_json to v1.0.134
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-22 01:26:47 +00:00
063a86b6ae chore(deps): update rust crate serde to v1.0.216
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-11 05:26:19 +00:00
2dcec0f6e2 fix(deps): update rust crate chrono to v0.4.39
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-10 01:28:14 +00:00
3e08ffe954 chore(deps): update rust crate clap to v4.5.23
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-06 01:35:27 +00:00
917cbfe372 chore(deps): update all dependencies
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-04 01:34:52 +00:00
bd0158d04d fix(deps): update rust crate tracing to v0.1.41
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-28 01:30:41 +00:00
b43c322dbd chore(deps): update rust crate serde_json to v1.0.133
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-17 05:24:58 +00:00
453f405124 feat: remove deps
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-11-16 17:11:30 +01:00
c05442baf6 feat: remove ci
All checks were successful
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-11-16 17:11:06 +01:00
10 changed files with 561 additions and 2554 deletions

998
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,5 +1,5 @@
[workspace]
members = ["crates/*", "examples/*", "ci"]
members = ["crates/*", "examples/*"]
resolver = "2"
[workspace.package]
@@ -15,9 +15,8 @@ cuddle-components = { path = "crates/cuddle-components" }
dagger-components = { path = "crates/dagger-components" }
dagger-cuddle-please = { path = "crates/dagger-cuddle-please" }
dagger-rust = { path = "crates/dagger-rust" }
ci = { path = "ci" }
dagger-sdk = "0.13.7"
dagger-sdk = "0.18.3"
eyre = "0.6"
tokio = "1"
dotenv = "0.15.0"

1861
ci/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,19 +0,0 @@
[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]
dagger-cuddle-please.workspace = true
dagger-rust.workspace = true
dagger-sdk.workspace = true
eyre = "*"
color-eyre = "*"
tokio = "1"
clap = { version = "4", features = ["derive"] }
futures = "0.3"
async-scoped = { version = "0.9.0", features = ["tokio", "use-tokio"] }
dotenv.workspace = true

View File

@@ -1,158 +0,0 @@
use std::path::PathBuf;
use clap::Args;
use clap::Parser;
use clap::Subcommand;
use clap::ValueEnum;
use crate::please_release::run_release_please;
#[derive(Parser, Clone)]
#[command(author, version, about, long_about = None, subcommand_required = true)]
pub struct Command {
#[command(subcommand)]
commands: Commands,
#[command(flatten)]
global: GlobalArgs,
}
#[derive(Subcommand, Clone)]
pub enum Commands {
#[command(subcommand_required = true)]
Local {
#[command(subcommand)]
command: LocalCommands,
},
PullRequest {},
Main {},
Release,
}
#[derive(Subcommand, Clone)]
pub enum LocalCommands {
Test,
PleaseRelease,
}
#[derive(Debug, Clone, ValueEnum)]
pub enum BuildProfile {
Debug,
Release,
}
#[derive(Debug, Clone, Args)]
pub struct GlobalArgs {
#[arg(long, global = true, help_heading = "Global")]
dry_run: bool,
#[arg(long, global = true, help_heading = "Global")]
rust_builder_image: Option<String>,
#[arg(long, global = true, help_heading = "Global")]
cuddle_please_image: Option<String>,
#[arg(long, global = true, help_heading = "Global")]
source: Option<PathBuf>,
}
#[tokio::main]
async fn main() -> eyre::Result<()> {
let _ = dotenv::dotenv();
let _ = color_eyre::install();
let cli = Command::parse();
dagger_sdk::connect(|client| async move {
match &cli.commands {
Commands::Local { command } => match command {
LocalCommands::Test => {
test::execute(client, &cli.global).await?;
}
LocalCommands::PleaseRelease => todo!(),
},
Commands::PullRequest {} => {
async fn test(client: dagger_sdk::Query, cli: &Command) {
let args = &cli.global;
test::execute(client.clone(), args).await.unwrap();
}
tokio::join!(test(client.clone(), &cli),);
}
Commands::Main {} => {
async fn test(client: dagger_sdk::Query, cli: &Command) {
let args = &cli.global;
test::execute(client.clone(), args).await.unwrap();
}
async fn cuddle_please(client: dagger_sdk::Query, cli: &Command) {
run_release_please(client.clone(), &cli.global)
.await
.unwrap();
}
tokio::join!(
test(client.clone(), &cli),
cuddle_please(client.clone(), &cli)
);
}
Commands::Release => {}
}
Ok(())
})
.await?;
Ok(())
}
mod please_release {
use dagger_cuddle_please::{models::CuddlePleaseSrcArgs, DaggerCuddlePleaseAction};
use crate::GlobalArgs;
pub async fn run_release_please(
client: dagger_sdk::Query,
args: &GlobalArgs,
) -> eyre::Result<()> {
DaggerCuddlePleaseAction::dagger(client)
.execute_src(&CuddlePleaseSrcArgs {
cuddle_image: args
.cuddle_please_image
.clone()
.unwrap_or("kasperhermansen/cuddle-please:latest".into()),
server: dagger_cuddle_please::models::SrcServer::Gitea {
token: std::env::var("CUDDLE_PLEASE_TOKEN")
.expect("CUDDLE_PLEASE_TOKEN to be present"),
},
log_level: Some(dagger_cuddle_please::models::LogLevel::Debug),
})
.await?;
Ok(())
}
}
mod test {
use std::path::PathBuf;
use dagger_rust::build::RustVersion;
use crate::GlobalArgs;
pub async fn execute(client: dagger_sdk::Query, _args: &GlobalArgs) -> eyre::Result<()> {
dagger_rust::test::RustTest::new(client)
.test(
None::<PathBuf>,
RustVersion::Nightly,
&["crates/*", "examples/*", "ci"],
&[],
)
.await?;
Ok(())
}
}

View File

@@ -63,8 +63,12 @@ impl CuddleCI {
self
}
pub fn with_release(&mut self, release: Box<dyn ReleaseAction + Send + Sync>) -> &mut Self {
self.release_action.push(release);
pub fn with_release<T>(&mut self, release: &T) -> &mut Self
where
T: ReleaseAction + Send + Sync + 'static,
T: ToOwned<Owned = T>,
{
self.release_action.push(Box::new(release.to_owned()));
self
}

View File

@@ -56,9 +56,19 @@ pub struct CuddleVars {
pub service: String,
pub registry: String,
pub rust: Option<CuddleRustVars>,
pub clusters: Option<CuddleClusters>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub struct CuddleRustVars {
pub publish: Option<CuddleRustPublishVars>,
}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub struct CuddleRustPublishVars {}
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub struct CuddleDeployment {
pub registry: String,
@@ -168,6 +178,7 @@ scripts:
service: "infrastructure-example".into(),
registry: "kasperhermansen".into(),
clusters: Some(CuddleClusters(clusters)),
rust: None,
},
deployment: Some(crate::cuddle_file::CuddleDeployment {
registry: "git@git.front.kjuulh.io:kjuulh/clank-clusters".into(),
@@ -215,6 +226,7 @@ components:
service: "infrastructure-example".into(),
registry: "kasperhermansen".into(),
clusters: None,
rust: None,
},
deployment: None,
components: Some(CuddleComponents {
@@ -253,6 +265,7 @@ components:
service: "infrastructure-example".into(),
registry: "kasperhermansen".into(),
clusters: None,
rust: None,
},
deployment: None,
components: Some(CuddleComponents {

View File

@@ -23,7 +23,7 @@ impl MainAction for CuddlePlease {
action
.cuddle_please_src(&CuddlePleaseSrcArgs {
cuddle_image: "kasperhermansen/cuddle-please:main-1712698022".into(),
cuddle_image: "kasperhermansen/cuddle-please:main-1736464837".into(),
server: dagger_cuddle_please::models::SrcServer::Gitea {
token: std::env::var("CUDDLE_PLEASE_TOKEN")
.expect("CUDDLE_PLEASE_TOKEN to be present"),

View File

@@ -7,7 +7,7 @@ use futures::{stream, StreamExt};
use crate::{
dagger_middleware::{DaggerMiddleware, DynMiddleware},
Context, MainAction, PullRequestAction,
Context, MainAction, PullRequestAction, ReleaseAction,
};
use self::architecture::{Architecture, Os};
@@ -348,6 +348,32 @@ impl PullRequestAction for RustService {
}
}
#[async_trait]
impl ReleaseAction for RustService {
async fn execute_release(&self, ctx: &mut Context) -> eyre::Result<()> {
self.build_test().await?;
let container = self.build_release().await?;
let tag = {
if let Ok(tag) = std::env::var("RELEASE_TAG") {
tag
} else if let Ok(tag) = std::env::var("DRONE_TAG") {
tag
} else {
eyre::bail!("failed to find a valid tag");
}
};
let tag = format!("docker.io/kasperhermansen/{}:{}", self.bin_name, tag);
container.publish(&tag).await?;
ctx.set_image_tag(tag)?;
Ok(())
}
}
const IMAGE_TAG: &str = "RUST_SERVICE_IMAGE_TAG";
pub trait RustServiceContext {
@@ -488,8 +514,6 @@ pub mod extensions {
#[cfg(test)]
mod test {
#[tokio::test]
#[cfg(any(feature = "dagger", feature = "integration"))]
async fn test_can_build_rust() -> eyre::Result<()> {

View File

@@ -186,12 +186,11 @@ impl DaggerCuddlePlease {
self.client
.git_opts(
&repo_url,
dagger_sdk::QueryGitOpts {
experimental_service_host: None,
keep_git_dir: Some(true),
ssh_auth_socket: Some(socket.id().await?),
ssh_known_hosts: None,
},
dagger_sdk::QueryGitOptsBuilder::default()
.keep_git_dir(true)
.ssh_auth_socket(socket.id().await?)
.build()
.unwrap(),
)
.branch("main")
.tree()
@@ -199,12 +198,10 @@ impl DaggerCuddlePlease {
self.client
.git_opts(
&repo_url,
dagger_sdk::QueryGitOpts {
experimental_service_host: None,
keep_git_dir: Some(true),
ssh_auth_socket: None,
ssh_known_hosts: None,
},
dagger_sdk::QueryGitOptsBuilder::default()
.keep_git_dir(true)
.build()
.unwrap(),
)
.branch("main")
.tree()