fix(ci): repo should be ssh
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
Kasper Juul Hermansen 2023-08-12 20:50:23 +02:00
parent 7277e06c0b
commit 0b9709d5c4
Signed by: kjuulh
GPG Key ID: 9AA7BC13CE474394
2 changed files with 44 additions and 21 deletions

4
Cargo.lock generated
View File

@ -86,9 +86,9 @@ dependencies = [
[[package]]
name = "async-trait"
version = "0.1.72"
version = "0.1.73"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cc6dde6e4ed435a4c1ee4e73592f5ba9da2151af10076cc04858746af9352d09"
checksum = "bc00ceb34980c03614e35a3a4e218276a0a824e911d07651cd0d858a51e8c0f0"
dependencies = [
"proc-macro2",
"quote",

View File

@ -275,7 +275,6 @@ impl DaggerCuddlePlease {
args: &CuddlePleaseSrcArgs,
) -> eyre::Result<()> {
let build_image = client.container().from(&args.cuddle_image);
let res = build_image
.with_secret_variable(
"CUDDLE_PLEASE_TOKEN",
@ -309,6 +308,7 @@ impl DaggerCuddlePlease {
contents: Some(
"
Host *
User git
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
",
@ -316,26 +316,49 @@ Host *
owner: Some("root"),
permissions: Some(700),
},
)
.with_exec(vec![
"cuddle-please",
"release",
);
let remote_url = res
.with_exec(vec!["git", "config", "--get", "remote.origin.url"])
.stdout()
.await?;
let res = if remote_url.starts_with("http") {
res.with_exec(vec![
"git",
"config",
"--global",
&format!(
"--engine={}",
match &args.server {
SrcServer::Gitea { .. } => "gitea",
SrcServer::GitHub { .. } => "github",
}
"url.ssh://git@{}/.insteadOf",
remote_url
.trim_start_matches("https://")
.trim_start_matches("http://")
),
"--log-level",
match args.log_level.as_ref().unwrap_or(&LogLevel::Info) {
LogLevel::Trace => "trace",
LogLevel::Debug => "debug",
LogLevel::Info => "info",
LogLevel::Warn => "warn",
LogLevel::Error => "error",
},
]);
&remote_url,
])
} else {
res
};
let res = res.with_exec(vec![
"cuddle-please",
"release",
&format!(
"--engine={}",
match &args.server {
SrcServer::Gitea { .. } => "gitea",
SrcServer::GitHub { .. } => "github",
}
),
"--log-level",
match args.log_level.as_ref().unwrap_or(&LogLevel::Info) {
LogLevel::Trace => "trace",
LogLevel::Debug => "debug",
LogLevel::Info => "info",
LogLevel::Warn => "warn",
LogLevel::Error => "error",
},
]);
let exit_code = res.exit_code().await?;
if exit_code != 0 {