Compare commits
32 Commits
00524783d1
...
renovate/a
| Author | SHA1 | Date | |
|---|---|---|---|
| f6486c8717 | |||
|
2ca918bc05
|
|||
|
426d259699
|
|||
| c0e24492c4 | |||
|
e26e359d10
|
|||
|
2e714767a1
|
|||
| dfc4602eee | |||
| 14f9f5e317 | |||
| e1b74380ed | |||
| c79cc1da81 | |||
| 8ee0c408ef | |||
| e1187b326b | |||
| 6c04623646 | |||
| f7676fa5c3 | |||
| 35bc853548 | |||
| 15d8fe22b6 | |||
| 2c6ca7521d | |||
| b641feac89 | |||
| 855b8c0edc | |||
| 11326924bb | |||
|
63ed60d607
|
|||
|
7ea8af6b44
|
|||
| 0cc95dfc14 | |||
| f30d49cb14 | |||
| 69b27ceb42 | |||
| f2fdcdcaa0 | |||
| 838d0c606a | |||
| 68464938a3 | |||
| 7c9890a8d5 | |||
| 80a34851a6 | |||
| 2e43b9b723 | |||
| e1a2d03fbe |
18
CHANGELOG.md
18
CHANGELOG.md
@@ -6,24 +6,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
## [0.4.0] - 2024-12-22
|
|
||||||
|
|
||||||
### Added
|
|
||||||
- remove deps
|
|
||||||
- remove ci
|
|
||||||
|
|
||||||
### Fixed
|
|
||||||
- release action like main and pr
|
|
||||||
- *(deps)* update rust crate chrono to v0.4.39
|
|
||||||
- *(deps)* update rust crate tracing to v0.1.41
|
|
||||||
|
|
||||||
### Other
|
|
||||||
- *(deps)* update rust crate serde_json to v1.0.134
|
|
||||||
- *(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
|
## [0.3.0] - 2024-11-16
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
|
|||||||
1023
Cargo.lock
generated
1023
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@@ -3,12 +3,12 @@ members = ["crates/*", "examples/*"]
|
|||||||
resolver = "2"
|
resolver = "2"
|
||||||
|
|
||||||
[workspace.package]
|
[workspace.package]
|
||||||
version = "0.4.0"
|
version = "0.3.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
authors = ["kjuulh <contact@kjuulh.io>"]
|
authors = ["kjuulh <contact@kjuulh.io>"]
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
repository = "https://git.front.kjuulh.io/kjuulh/dagger-components"
|
repository = "https://git.kjuulh.io/kjuulh/dagger-components"
|
||||||
|
|
||||||
[workspace.dependencies]
|
[workspace.dependencies]
|
||||||
cuddle-components = { path = "crates/cuddle-components" }
|
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-cuddle-please = { path = "crates/dagger-cuddle-please" }
|
||||||
dagger-rust = { path = "crates/dagger-rust" }
|
dagger-rust = { path = "crates/dagger-rust" }
|
||||||
|
|
||||||
dagger-sdk = "0.13.7"
|
dagger-sdk = "0.18.19"
|
||||||
eyre = "0.6"
|
eyre = "0.6"
|
||||||
tokio = "1"
|
tokio = "1"
|
||||||
dotenv = "0.15.0"
|
dotenv = "0.15.0"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ serde_yaml.workspace = true
|
|||||||
serde.workspace = true
|
serde.workspace = true
|
||||||
tracing = {version = "0.1.40", features = ["log"]}
|
tracing = {version = "0.1.40", features = ["log"]}
|
||||||
chrono = {version = "0.4.38"}
|
chrono = {version = "0.4.38"}
|
||||||
toml = "0.8.12"
|
toml = "0.9.0"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
pretty_assertions = "1.4.0"
|
pretty_assertions = "1.4.0"
|
||||||
|
|||||||
@@ -56,9 +56,19 @@ 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,
|
||||||
@@ -102,7 +112,7 @@ mod test {
|
|||||||
#[test]
|
#[test]
|
||||||
fn parse_file() {
|
fn parse_file() {
|
||||||
let cuddle_file = r#"
|
let cuddle_file = r#"
|
||||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-base.git"
|
base: "git@git.kjuulh.io:kjuulh/cuddle-base.git"
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
service: "infrastructure-example"
|
service: "infrastructure-example"
|
||||||
@@ -114,7 +124,7 @@ vars:
|
|||||||
namespace: clank_prod
|
namespace: clank_prod
|
||||||
|
|
||||||
deployment:
|
deployment:
|
||||||
registry: git@git.front.kjuulh.io:kjuulh/clank-clusters
|
registry: git@git.kjuulh.io:kjuulh/clank-clusters
|
||||||
env:
|
env:
|
||||||
prod:
|
prod:
|
||||||
clusters:
|
clusters:
|
||||||
@@ -168,9 +178,10 @@ 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.kjuulh.io:kjuulh/clank-clusters".into(),
|
||||||
env: CuddleDeploymentEnv(deployment),
|
env: CuddleDeploymentEnv(deployment),
|
||||||
}),
|
}),
|
||||||
components: Some(CuddleComponents {
|
components: Some(CuddleComponents {
|
||||||
@@ -198,7 +209,7 @@ scripts:
|
|||||||
#[test]
|
#[test]
|
||||||
fn cuddle_database_default() {
|
fn cuddle_database_default() {
|
||||||
let cuddle_file = r#"
|
let cuddle_file = r#"
|
||||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-base.git"
|
base: "git@git.kjuulh.io:kjuulh/cuddle-base.git"
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
service: "infrastructure-example"
|
service: "infrastructure-example"
|
||||||
@@ -215,6 +226,7 @@ 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 {
|
||||||
@@ -231,7 +243,7 @@ components:
|
|||||||
#[test]
|
#[test]
|
||||||
fn cuddle_packages() {
|
fn cuddle_packages() {
|
||||||
let cuddle_file = r#"
|
let cuddle_file = r#"
|
||||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-base.git"
|
base: "git@git.kjuulh.io:kjuulh/cuddle-base.git"
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
service: "infrastructure-example"
|
service: "infrastructure-example"
|
||||||
@@ -253,6 +265,7 @@ 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-1712698022".into(),
|
cuddle_image: "kasperhermansen/cuddle-please:main-1736464837".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"),
|
||||||
|
|||||||
@@ -387,7 +387,7 @@ impl MainAction for LeptosService {
|
|||||||
"update-deployment",
|
"update-deployment",
|
||||||
"--repo",
|
"--repo",
|
||||||
&format!(
|
&format!(
|
||||||
"git@git.front.kjuulh.io:kjuulh/{}-deployment.git",
|
"git@git.kjuulh.io:kjuulh/{}-deployment.git",
|
||||||
self.get_deploy_target()
|
self.get_deploy_target()
|
||||||
),
|
),
|
||||||
"--service",
|
"--service",
|
||||||
@@ -405,7 +405,7 @@ impl MainAction for LeptosService {
|
|||||||
"update-deployment",
|
"update-deployment",
|
||||||
"--repo",
|
"--repo",
|
||||||
&format!(
|
&format!(
|
||||||
"https://git.front.kjuulh.io/kjuulh/{}-deployment.git",
|
"https://git.kjuulh.io/kjuulh/{}-deployment.git",
|
||||||
self.get_deploy_target()
|
self.get_deploy_target()
|
||||||
),
|
),
|
||||||
"--service",
|
"--service",
|
||||||
|
|||||||
@@ -255,7 +255,7 @@ impl MainAction for NodeService {
|
|||||||
"update-deployment",
|
"update-deployment",
|
||||||
"--repo",
|
"--repo",
|
||||||
&format!(
|
&format!(
|
||||||
"git@git.front.kjuulh.io:kjuulh/{}-deployment.git",
|
"git@git.kjuulh.io:kjuulh/{}-deployment.git",
|
||||||
self.service
|
self.service
|
||||||
),
|
),
|
||||||
"--service",
|
"--service",
|
||||||
@@ -273,7 +273,7 @@ impl MainAction for NodeService {
|
|||||||
"update-deployment",
|
"update-deployment",
|
||||||
"--repo",
|
"--repo",
|
||||||
&format!(
|
&format!(
|
||||||
"https://git.front.kjuulh.io/kjuulh/{}-deployment.git",
|
"https://git.kjuulh.io/kjuulh/{}-deployment.git",
|
||||||
self.service
|
self.service
|
||||||
),
|
),
|
||||||
"--service",
|
"--service",
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ use futures::{stream, StreamExt};
|
|||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
dagger_middleware::{DaggerMiddleware, DynMiddleware},
|
dagger_middleware::{DaggerMiddleware, DynMiddleware},
|
||||||
Context, MainAction, PullRequestAction,
|
Context, MainAction, PullRequestAction, ReleaseAction,
|
||||||
};
|
};
|
||||||
|
|
||||||
use self::architecture::{Architecture, Os};
|
use self::architecture::{Architecture, Os};
|
||||||
@@ -274,7 +274,7 @@ impl RustService {
|
|||||||
let dest = self
|
let dest = self
|
||||||
.final_image
|
.final_image
|
||||||
.clone()
|
.clone()
|
||||||
.unwrap_or(client.container().from("debian:bookworm"));
|
.unwrap_or(client.container().from("debian:trixie"));
|
||||||
|
|
||||||
let before_package = self
|
let before_package = self
|
||||||
.stages
|
.stages
|
||||||
@@ -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";
|
const IMAGE_TAG: &str = "RUST_SERVICE_IMAGE_TAG";
|
||||||
|
|
||||||
pub trait RustServiceContext {
|
pub trait RustServiceContext {
|
||||||
@@ -401,7 +427,7 @@ impl MainAction for RustService {
|
|||||||
"update-deployment",
|
"update-deployment",
|
||||||
"--repo",
|
"--repo",
|
||||||
&format!(
|
&format!(
|
||||||
"git@git.front.kjuulh.io:kjuulh/{}-deployment.git",
|
"git@git.kjuulh.io:kjuulh/{}-deployment.git",
|
||||||
self.bin_name
|
self.bin_name
|
||||||
),
|
),
|
||||||
"--service",
|
"--service",
|
||||||
@@ -419,7 +445,7 @@ impl MainAction for RustService {
|
|||||||
"update-deployment",
|
"update-deployment",
|
||||||
"--repo",
|
"--repo",
|
||||||
&format!(
|
&format!(
|
||||||
"https://git.front.kjuulh.io/kjuulh/{}-deployment.git",
|
"https://git.kjuulh.io/kjuulh/{}-deployment.git",
|
||||||
self.bin_name
|
self.bin_name
|
||||||
),
|
),
|
||||||
"--service",
|
"--service",
|
||||||
@@ -488,8 +514,6 @@ 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,12 +186,11 @@ impl DaggerCuddlePlease {
|
|||||||
self.client
|
self.client
|
||||||
.git_opts(
|
.git_opts(
|
||||||
&repo_url,
|
&repo_url,
|
||||||
dagger_sdk::QueryGitOpts {
|
dagger_sdk::QueryGitOptsBuilder::default()
|
||||||
experimental_service_host: None,
|
.keep_git_dir(true)
|
||||||
keep_git_dir: Some(true),
|
.ssh_auth_socket(socket.id().await?)
|
||||||
ssh_auth_socket: Some(socket.id().await?),
|
.build()
|
||||||
ssh_known_hosts: None,
|
.unwrap(),
|
||||||
},
|
|
||||||
)
|
)
|
||||||
.branch("main")
|
.branch("main")
|
||||||
.tree()
|
.tree()
|
||||||
@@ -199,12 +198,10 @@ impl DaggerCuddlePlease {
|
|||||||
self.client
|
self.client
|
||||||
.git_opts(
|
.git_opts(
|
||||||
&repo_url,
|
&repo_url,
|
||||||
dagger_sdk::QueryGitOpts {
|
dagger_sdk::QueryGitOptsBuilder::default()
|
||||||
experimental_service_host: None,
|
.keep_git_dir(true)
|
||||||
keep_git_dir: Some(true),
|
.build()
|
||||||
ssh_auth_socket: None,
|
.unwrap(),
|
||||||
ssh_known_hosts: None,
|
|
||||||
},
|
|
||||||
)
|
)
|
||||||
.branch("main")
|
.branch("main")
|
||||||
.tree()
|
.tree()
|
||||||
|
|||||||
@@ -128,6 +128,7 @@ impl RustSource {
|
|||||||
dagger_sdk::DirectoryWithDirectoryOpts {
|
dagger_sdk::DirectoryWithDirectoryOpts {
|
||||||
exclude: Some(exclude),
|
exclude: Some(exclude),
|
||||||
include: None,
|
include: None,
|
||||||
|
owner: None,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
# yaml-language-server: $schema=https://git.front.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
# yaml-language-server: $schema=https://git.kjuulh.io/kjuulh/cuddle/raw/branch/main/schemas/base.json
|
||||||
|
|
||||||
base: "git@git.front.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
|
base: "git@git.kjuulh.io:kjuulh/cuddle-rust-lib-plan.git"
|
||||||
|
|
||||||
vars:
|
vars:
|
||||||
service: "dagger-components"
|
service: "dagger-components"
|
||||||
@@ -14,7 +14,7 @@ please:
|
|||||||
repository: dagger-components
|
repository: dagger-components
|
||||||
branch: main
|
branch: main
|
||||||
settings:
|
settings:
|
||||||
api_url: https://git.front.kjuulh.io
|
api_url: https://git.kjuulh.io
|
||||||
actions:
|
actions:
|
||||||
rust:
|
rust:
|
||||||
|
|
||||||
|
|||||||
@@ -3,4 +3,4 @@ project:
|
|||||||
repository: dagger-components
|
repository: dagger-components
|
||||||
branch: main
|
branch: main
|
||||||
settings:
|
settings:
|
||||||
api_url: https://git.front.kjuulh.io
|
api_url: https://git.kjuulh.io
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ pub async fn main() -> eyre::Result<()> {
|
|||||||
branch: "main".into(),
|
branch: "main".into(),
|
||||||
cuddle_image: "kasperhermansen/cuddle-please:latest".into(),
|
cuddle_image: "kasperhermansen/cuddle-please:latest".into(),
|
||||||
server: dagger_cuddle_please::models::Server::Gitea {
|
server: dagger_cuddle_please::models::Server::Gitea {
|
||||||
url: "https://git.front.kjuulh.io".into(),
|
url: "https://git.kjuulh.io".into(),
|
||||||
user: "git".into(),
|
user: "git".into(),
|
||||||
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"),
|
||||||
|
|||||||
Reference in New Issue
Block a user