4 Commits

Author SHA1 Message Date
a17e527b91 chore(deps): update rust crate tokio to 1.31.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2023-08-12 16:53:55 +00:00
5c53589c27 refactor(ci): move cuddle please image to cuddle
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-12 12:26:12 +02:00
8c3b5e660f feat(ci): with internal please action
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
Signed-off-by: kjuulh <contact@kjuulh.io>
2023-08-11 18:23:05 +00:00
37054fa012 Add renovate.json
All checks were successful
continuous-integration/drone/push Build is passing
2023-08-11 18:22:57 +00:00
8 changed files with 30 additions and 59 deletions

5
Cargo.lock generated
View File

@@ -183,6 +183,7 @@ dependencies = [
"async-scoped",
"clap",
"color-eyre",
"dagger-cuddle-please",
"dagger-sdk",
"dotenv",
"eyre",
@@ -1507,9 +1508,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.30.0"
version = "1.31.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d3ce25f50619af8b0aec2eb23deebe84249e19e2ddd393a6e16e3300a6dadfd"
checksum = "40de3a2ba249dcb097e01be5e67a5ff53cf250397715a071a81543e8a832a920"
dependencies = [
"backtrace",
"bytes",

View File

@@ -14,5 +14,5 @@ ci = {path = "ci"}
dagger-sdk = "0.2.22"
eyre = "0.6.8"
tokio = "1.30.0"
tokio = "1.31.0"
dotenv = "*"

View File

@@ -6,6 +6,8 @@ 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-sdk = "*"
eyre = "*"
color-eyre = "*"

View File

@@ -51,6 +51,9 @@ pub struct GlobalArgs {
#[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>,
}
@@ -119,67 +122,27 @@ async fn main() -> eyre::Result<()> {
mod please_release {
use std::sync::Arc;
use dagger_cuddle_please::{models::CuddlePleaseSrcArgs, DaggerCuddlePleaseAction};
use crate::GlobalArgs;
pub async fn run_release_please(
client: Arc<dagger_sdk::Query>,
args: &GlobalArgs,
) -> eyre::Result<()> {
let build_image = client
.container()
.from("kasperhermansen/cuddle-please:main-1691504183");
let src = client
.git_opts(
"https://git.front.kjuulh.io/kjuulh/dagger-components",
dagger_sdk::QueryGitOpts {
experimental_service_host: None,
keep_git_dir: Some(true),
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"),
},
)
.branch("main")
.tree();
let res = build_image
.with_secret_variable(
"CUDDLE_PLEASE_TOKEN",
client
.set_secret("CUDDLE_PLEASE_TOKEN", std::env::var("CUDDLE_PLEASE_TOKEN")?)
.id()
.await?,
)
.with_workdir("/mnt/app")
.with_directory(".", src.id().await?)
.with_exec(vec![
"git",
"remote",
"set-url",
"origin",
&format!(
"https://git:{}@git.front.kjuulh.io/kjuulh/dagger-components.git",
std::env::var("CUDDLE_PLEASE_TOKEN")?
),
])
.with_exec(vec![
"cuddle-please",
"release",
"--engine=gitea",
"--owner=kjuulh",
"--repo=dagger-components",
"--branch=main",
"--api-url=https://git.front.kjuulh.io",
"--log-level=debug",
]);
let exit_code = res.exit_code().await?;
if exit_code != 0 {
eyre::bail!("failed to run cuddle-please");
}
let please_out = res.stdout().await?;
println!("{please_out}");
let please_out = res.stderr().await?;
println!("{please_out}");
log_level: Some(dagger_cuddle_please::models::LogLevel::Debug),
})
.await?;
Ok(())
}

View File

@@ -6,6 +6,8 @@ vars:
service: "dagger-components"
registry: kasperhermansen
cuddle_please_image: "kasperhermansen/cuddle-please:main-1691504183"
please:
project:
owner: kjuulh

3
renovate.json Normal file
View File

@@ -0,0 +1,3 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json"
}

View File

@@ -9,4 +9,4 @@ if [[ -n "$CI_PREFIX" ]]; then
fi
$CMD_PREFIX main
$CMD_PREFIX main --cuddle-please-image="$CUDDLE_PLEASE_IMAGE"

View File

@@ -8,4 +8,4 @@ if [[ -n "$CI_PREFIX" ]]; then
CMD_PREFIX="$CI_PREFIX"
fi
$CMD_PREFIX pull-request
$CMD_PREFIX pull-request --cuddle-please-image="$CUDDLE_PLEASE_IMAGE"