Compare commits
1 Commits
main
...
e9080be1e8
Author | SHA1 | Date | |
---|---|---|---|
|
e9080be1e8 |
14
CHANGELOG.md
14
CHANGELOG.md
@@ -6,6 +6,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [0.4.0] - 2024-12-06
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- remove deps
|
||||||
|
- remove ci
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- *(deps)* update rust crate tracing to v0.1.41
|
||||||
|
|
||||||
|
### Other
|
||||||
|
- *(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
|
## [0.3.0] - 2024-11-16
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
884
Cargo.lock
generated
884
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -3,7 +3,7 @@ members = ["crates/*", "examples/*"]
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.3.0"
|
version = "0.4.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["kjuulh <contact@kjuulh.io>"]
|
authors = ["kjuulh <contact@kjuulh.io>"]
|
||||||
@@ -16,7 +16,7 @@ dagger-components = { path = "crates/dagger-components" }
|
|||||||
dagger-cuddle-please = { path = "crates/dagger-cuddle-please" }
|
dagger-cuddle-please = { path = "crates/dagger-cuddle-please" }
|
||||||
dagger-rust = { path = "crates/dagger-rust" }
|
dagger-rust = { path = "crates/dagger-rust" }
|
||||||
|
|
||||||
dagger-sdk = "0.18.3"
|
dagger-sdk = "0.13.7"
|
||||||
eyre = "0.6"
|
eyre = "0.6"
|
||||||
tokio = "1"
|
tokio = "1"
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
|
@@ -63,12 +63,8 @@ impl CuddleCI {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn with_release<T>(&mut self, release: &T) -> &mut Self
|
pub fn with_release(&mut self, release: Box<dyn ReleaseAction + Send + Sync>) -> &mut Self {
|
||||||
where
|
self.release_action.push(release);
|
||||||
T: ReleaseAction + Send + Sync + 'static,
|
|
||||||
T: ToOwned<Owned = T>,
|
|
||||||
{
|
|
||||||
self.release_action.push(Box::new(release.to_owned()));
|
|
||||||
|
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
@@ -56,19 +56,9 @@ pub struct CuddleVars {
|
|||||||
pub service: String,
|
pub service: String,
|
||||||
pub registry: String,
|
pub registry: String,
|
||||||
|
|
||||||
pub rust: Option<CuddleRustVars>,
|
|
||||||
|
|
||||||
pub clusters: Option<CuddleClusters>,
|
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)]
|
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
|
||||||
pub struct CuddleDeployment {
|
pub struct CuddleDeployment {
|
||||||
pub registry: String,
|
pub registry: String,
|
||||||
@@ -178,7 +168,6 @@ scripts:
|
|||||||
service: "infrastructure-example".into(),
|
service: "infrastructure-example".into(),
|
||||||
registry: "kasperhermansen".into(),
|
registry: "kasperhermansen".into(),
|
||||||
clusters: Some(CuddleClusters(clusters)),
|
clusters: Some(CuddleClusters(clusters)),
|
||||||
rust: None,
|
|
||||||
},
|
},
|
||||||
deployment: Some(crate::cuddle_file::CuddleDeployment {
|
deployment: Some(crate::cuddle_file::CuddleDeployment {
|
||||||
registry: "git@git.front.kjuulh.io:kjuulh/clank-clusters".into(),
|
registry: "git@git.front.kjuulh.io:kjuulh/clank-clusters".into(),
|
||||||
@@ -226,7 +215,6 @@ components:
|
|||||||
service: "infrastructure-example".into(),
|
service: "infrastructure-example".into(),
|
||||||
registry: "kasperhermansen".into(),
|
registry: "kasperhermansen".into(),
|
||||||
clusters: None,
|
clusters: None,
|
||||||
rust: None,
|
|
||||||
},
|
},
|
||||||
deployment: None,
|
deployment: None,
|
||||||
components: Some(CuddleComponents {
|
components: Some(CuddleComponents {
|
||||||
@@ -265,7 +253,6 @@ components:
|
|||||||
service: "infrastructure-example".into(),
|
service: "infrastructure-example".into(),
|
||||||
registry: "kasperhermansen".into(),
|
registry: "kasperhermansen".into(),
|
||||||
clusters: None,
|
clusters: None,
|
||||||
rust: None,
|
|
||||||
},
|
},
|
||||||
deployment: None,
|
deployment: None,
|
||||||
components: Some(CuddleComponents {
|
components: Some(CuddleComponents {
|
||||||
|
@@ -23,7 +23,7 @@ impl MainAction for CuddlePlease {
|
|||||||
|
|
||||||
action
|
action
|
||||||
.cuddle_please_src(&CuddlePleaseSrcArgs {
|
.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 {
|
server: dagger_cuddle_please::models::SrcServer::Gitea {
|
||||||
token: std::env::var("CUDDLE_PLEASE_TOKEN")
|
token: std::env::var("CUDDLE_PLEASE_TOKEN")
|
||||||
.expect("CUDDLE_PLEASE_TOKEN to be present"),
|
.expect("CUDDLE_PLEASE_TOKEN to be present"),
|
||||||
|
@@ -7,7 +7,7 @@ use futures::{stream, StreamExt};
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
dagger_middleware::{DaggerMiddleware, DynMiddleware},
|
dagger_middleware::{DaggerMiddleware, DynMiddleware},
|
||||||
Context, MainAction, PullRequestAction, ReleaseAction,
|
Context, MainAction, PullRequestAction,
|
||||||
};
|
};
|
||||||
|
|
||||||
use self::architecture::{Architecture, Os};
|
use self::architecture::{Architecture, Os};
|
||||||
@@ -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";
|
const IMAGE_TAG: &str = "RUST_SERVICE_IMAGE_TAG";
|
||||||
|
|
||||||
pub trait RustServiceContext {
|
pub trait RustServiceContext {
|
||||||
@@ -514,6 +488,8 @@ pub mod extensions {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod test {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
#[cfg(any(feature = "dagger", feature = "integration"))]
|
#[cfg(any(feature = "dagger", feature = "integration"))]
|
||||||
async fn test_can_build_rust() -> eyre::Result<()> {
|
async fn test_can_build_rust() -> eyre::Result<()> {
|
||||||
|
@@ -186,11 +186,12 @@ impl DaggerCuddlePlease {
|
|||||||
self.client
|
self.client
|
||||||
.git_opts(
|
.git_opts(
|
||||||
&repo_url,
|
&repo_url,
|
||||||
dagger_sdk::QueryGitOptsBuilder::default()
|
dagger_sdk::QueryGitOpts {
|
||||||
.keep_git_dir(true)
|
experimental_service_host: None,
|
||||||
.ssh_auth_socket(socket.id().await?)
|
keep_git_dir: Some(true),
|
||||||
.build()
|
ssh_auth_socket: Some(socket.id().await?),
|
||||||
.unwrap(),
|
ssh_known_hosts: None,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
.branch("main")
|
.branch("main")
|
||||||
.tree()
|
.tree()
|
||||||
@@ -198,10 +199,12 @@ impl DaggerCuddlePlease {
|
|||||||
self.client
|
self.client
|
||||||
.git_opts(
|
.git_opts(
|
||||||
&repo_url,
|
&repo_url,
|
||||||
dagger_sdk::QueryGitOptsBuilder::default()
|
dagger_sdk::QueryGitOpts {
|
||||||
.keep_git_dir(true)
|
experimental_service_host: None,
|
||||||
.build()
|
keep_git_dir: Some(true),
|
||||||
.unwrap(),
|
ssh_auth_socket: None,
|
||||||
|
ssh_known_hosts: None,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
.branch("main")
|
.branch("main")
|
||||||
.tree()
|
.tree()
|
||||||
|
Reference in New Issue
Block a user