Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
parent
1cf349c3c6
commit
03784be431
@ -275,7 +275,6 @@ impl DaggerCuddlePlease {
|
|||||||
args: &CuddlePleaseSrcArgs,
|
args: &CuddlePleaseSrcArgs,
|
||||||
) -> eyre::Result<()> {
|
) -> eyre::Result<()> {
|
||||||
let build_image = client.container().from(&args.cuddle_image);
|
let build_image = client.container().from(&args.cuddle_image);
|
||||||
|
|
||||||
let res = build_image
|
let res = build_image
|
||||||
.with_secret_variable(
|
.with_secret_variable(
|
||||||
"CUDDLE_PLEASE_TOKEN",
|
"CUDDLE_PLEASE_TOKEN",
|
||||||
@ -317,26 +316,49 @@ Host *
|
|||||||
owner: Some("root"),
|
owner: Some("root"),
|
||||||
permissions: Some(700),
|
permissions: Some(700),
|
||||||
},
|
},
|
||||||
)
|
);
|
||||||
.with_exec(vec![
|
|
||||||
"cuddle-please",
|
let remote_url = res
|
||||||
"release",
|
.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!(
|
&format!(
|
||||||
"--engine={}",
|
"url.ssh://git@{}/.insteadOf",
|
||||||
match &args.server {
|
remote_url
|
||||||
SrcServer::Gitea { .. } => "gitea",
|
.trim_start_matches("https://")
|
||||||
SrcServer::GitHub { .. } => "github",
|
.trim_start_matches("http://")
|
||||||
}
|
|
||||||
),
|
),
|
||||||
"--log-level",
|
&remote_url,
|
||||||
match args.log_level.as_ref().unwrap_or(&LogLevel::Info) {
|
])
|
||||||
LogLevel::Trace => "trace",
|
} else {
|
||||||
LogLevel::Debug => "debug",
|
res
|
||||||
LogLevel::Info => "info",
|
};
|
||||||
LogLevel::Warn => "warn",
|
|
||||||
LogLevel::Error => "error",
|
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?;
|
let exit_code = res.exit_code().await?;
|
||||||
if exit_code != 0 {
|
if exit_code != 0 {
|
||||||
|
Loading…
Reference in New Issue
Block a user