1 Commits

Author SHA1 Message Date
cuddle-please
2beea0f4ad chore(release): 0.4.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-12 01:31:46 +00:00
14 changed files with 535 additions and 619 deletions

View File

@@ -6,6 +6,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
## [0.4.0] - 2024-12-12
### Added
- remove deps
- remove ci
### Fixed
- *(deps)* update rust crate chrono to v0.4.39
- *(deps)* update rust crate tracing to v0.1.41
### Other
- *(deps)* update rust crate serde to v1.0.216
- *(deps)* update rust crate clap to v4.5.23
- *(deps)* update all dependencies
- *(deps)* update rust crate serde_json to v1.0.133
## [0.3.0] - 2024-11-16
### Added

1023
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -3,12 +3,12 @@ members = ["crates/*", "examples/*"]
resolver = "2"
[workspace.package]
version = "0.3.0"
version = "0.4.0"
edition = "2021"
license = "MIT"
authors = ["kjuulh <contact@kjuulh.io>"]
readme = "README.md"
repository = "https://git.kjuulh.io/kjuulh/dagger-components"
repository = "https://git.front.kjuulh.io/kjuulh/dagger-components"
[workspace.dependencies]
cuddle-components = { path = "crates/cuddle-components" }
@@ -16,7 +16,7 @@ dagger-components = { path = "crates/dagger-components" }
dagger-cuddle-please = { path = "crates/dagger-cuddle-please" }
dagger-rust = { path = "crates/dagger-rust" }
dagger-sdk = "0.18.19"
dagger-sdk = "0.13.7"
eyre = "0.6"
tokio = "1"
dotenv = "0.15.0"

View File

@@ -63,12 +63,8 @@ impl CuddleCI {
self
}
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()));
pub fn with_release(&mut self, release: Box<dyn ReleaseAction + Send + Sync>) -> &mut Self {
self.release_action.push(release);
self
}

View File

@@ -56,19 +56,9 @@ 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,
@@ -112,7 +102,7 @@ mod test {
#[test]
fn parse_file() {
let cuddle_file = r#"
base: "git@git.kjuulh.io:kjuulh/cuddle-base.git"
base: "git@git.front.kjuulh.io:kjuulh/cuddle-base.git"
vars:
service: "infrastructure-example"
@@ -124,7 +114,7 @@ vars:
namespace: clank_prod
deployment:
registry: git@git.kjuulh.io:kjuulh/clank-clusters
registry: git@git.front.kjuulh.io:kjuulh/clank-clusters
env:
prod:
clusters:
@@ -178,10 +168,9 @@ scripts:
service: "infrastructure-example".into(),
registry: "kasperhermansen".into(),
clusters: Some(CuddleClusters(clusters)),
rust: None,
},
deployment: Some(crate::cuddle_file::CuddleDeployment {
registry: "git@git.kjuulh.io:kjuulh/clank-clusters".into(),
registry: "git@git.front.kjuulh.io:kjuulh/clank-clusters".into(),
env: CuddleDeploymentEnv(deployment),
}),
components: Some(CuddleComponents {
@@ -209,7 +198,7 @@ scripts:
#[test]
fn cuddle_database_default() {
let cuddle_file = r#"
base: "git@git.kjuulh.io:kjuulh/cuddle-base.git"
base: "git@git.front.kjuulh.io:kjuulh/cuddle-base.git"
vars:
service: "infrastructure-example"
@@ -226,7 +215,6 @@ components:
service: "infrastructure-example".into(),
registry: "kasperhermansen".into(),
clusters: None,
rust: None,
},
deployment: None,
components: Some(CuddleComponents {
@@ -243,7 +231,7 @@ components:
#[test]
fn cuddle_packages() {
let cuddle_file = r#"
base: "git@git.kjuulh.io:kjuulh/cuddle-base.git"
base: "git@git.front.kjuulh.io:kjuulh/cuddle-base.git"
vars:
service: "infrastructure-example"
@@ -265,7 +253,6 @@ 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-1736464837".into(),
cuddle_image: "kasperhermansen/cuddle-please:main-1712698022".into(),
server: dagger_cuddle_please::models::SrcServer::Gitea {
token: std::env::var("CUDDLE_PLEASE_TOKEN")
.expect("CUDDLE_PLEASE_TOKEN to be present"),

View File

@@ -387,7 +387,7 @@ impl MainAction for LeptosService {
"update-deployment",
"--repo",
&format!(
"git@git.kjuulh.io:kjuulh/{}-deployment.git",
"git@git.front.kjuulh.io:kjuulh/{}-deployment.git",
self.get_deploy_target()
),
"--service",
@@ -405,7 +405,7 @@ impl MainAction for LeptosService {
"update-deployment",
"--repo",
&format!(
"https://git.kjuulh.io/kjuulh/{}-deployment.git",
"https://git.front.kjuulh.io/kjuulh/{}-deployment.git",
self.get_deploy_target()
),
"--service",

View File

@@ -255,7 +255,7 @@ impl MainAction for NodeService {
"update-deployment",
"--repo",
&format!(
"git@git.kjuulh.io:kjuulh/{}-deployment.git",
"git@git.front.kjuulh.io:kjuulh/{}-deployment.git",
self.service
),
"--service",
@@ -273,7 +273,7 @@ impl MainAction for NodeService {
"update-deployment",
"--repo",
&format!(
"https://git.kjuulh.io/kjuulh/{}-deployment.git",
"https://git.front.kjuulh.io/kjuulh/{}-deployment.git",
self.service
),
"--service",

View File

@@ -7,7 +7,7 @@ use futures::{stream, StreamExt};
use crate::{
dagger_middleware::{DaggerMiddleware, DynMiddleware},
Context, MainAction, PullRequestAction, ReleaseAction,
Context, MainAction, PullRequestAction,
};
use self::architecture::{Architecture, Os};
@@ -274,7 +274,7 @@ impl RustService {
let dest = self
.final_image
.clone()
.unwrap_or(client.container().from("debian:trixie"));
.unwrap_or(client.container().from("debian:bookworm"));
let before_package = self
.stages
@@ -348,32 +348,6 @@ 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 {
@@ -427,7 +401,7 @@ impl MainAction for RustService {
"update-deployment",
"--repo",
&format!(
"git@git.kjuulh.io:kjuulh/{}-deployment.git",
"git@git.front.kjuulh.io:kjuulh/{}-deployment.git",
self.bin_name
),
"--service",
@@ -445,7 +419,7 @@ impl MainAction for RustService {
"update-deployment",
"--repo",
&format!(
"https://git.kjuulh.io/kjuulh/{}-deployment.git",
"https://git.front.kjuulh.io/kjuulh/{}-deployment.git",
self.bin_name
),
"--service",
@@ -514,6 +488,8 @@ 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,11 +186,12 @@ impl DaggerCuddlePlease {
self.client
.git_opts(
&repo_url,
dagger_sdk::QueryGitOptsBuilder::default()
.keep_git_dir(true)
.ssh_auth_socket(socket.id().await?)
.build()
.unwrap(),
dagger_sdk::QueryGitOpts {
experimental_service_host: None,
keep_git_dir: Some(true),
ssh_auth_socket: Some(socket.id().await?),
ssh_known_hosts: None,
},
)
.branch("main")
.tree()
@@ -198,10 +199,12 @@ impl DaggerCuddlePlease {
self.client
.git_opts(
&repo_url,
dagger_sdk::QueryGitOptsBuilder::default()
.keep_git_dir(true)
.build()
.unwrap(),
dagger_sdk::QueryGitOpts {
experimental_service_host: None,
keep_git_dir: Some(true),
ssh_auth_socket: None,
ssh_known_hosts: None,
},
)
.branch("main")
.tree()

View File

@@ -128,7 +128,6 @@ impl RustSource {
dagger_sdk::DirectoryWithDirectoryOpts {
exclude: Some(exclude),
include: None,
owner: None,
},
);

View File

@@ -1,6 +1,6 @@
# yaml-language-server: $schema=https://git.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
# yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
base: "git@git.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
vars:
service: "dagger-components"
@@ -14,7 +14,7 @@ please:
repository: dagger-components
branch: main
settings:
api_url: https://git.kjuulh.io
api_url: https://git.front.kjuulh.io
actions:
rust:

View File

@@ -3,4 +3,4 @@ project:
repository: dagger-components
branch: main
settings:
api_url: https://git.kjuulh.io
api_url: https://git.front.kjuulh.io

View File

@@ -10,7 +10,7 @@ pub async fn main() -> eyre::Result<()> {
branch: "main".into(),
cuddle_image: "kasperhermansen/cuddle-please:latest".into(),
server: dagger_cuddle_please::models::Server::Gitea {
url: "https://git.kjuulh.io".into(),
url: "https://git.front.kjuulh.io".into(),
user: "git".into(),
token: std::env::var("CUDDLE_PLEASE_TOKEN")
.expect("CUDDLE_PLEASE_TOKEN to be present"),