Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions registry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1593,6 +1593,7 @@ psc-package.backends = [
]
psqldef.backends = ["aqua:sqldef/sqldef/psqldef"]
pulumi.backends = ["aqua:pulumi/pulumi", "asdf:canha/asdf-pulumi"]
pulumi.test = ["pulumi version", "v{{version}}"]
purerl.backends = ["ubi:purerl/purerl", "asdf:GoNZooo/asdf-purerl"]
purescript.backends = [
"ubi:purescript/purescript[exe=purs]",
Expand Down
7 changes: 7 additions & 0 deletions src/aqua/aqua_registry.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ pub struct AquaCosign {
pub signature: Option<AquaCosignSignature>,
pub key: Option<AquaCosignSignature>,
pub certificate: Option<AquaCosignSignature>,
pub bundle: Option<AquaCosignSignature>,
#[serde(skip_serializing_if = "Vec::is_empty", default)]
opts: Vec<String>,
}
Expand Down Expand Up @@ -688,6 +689,12 @@ impl AquaCosign {
}
self.certificate.as_mut().unwrap().merge(certificate);
}
if let Some(bundle) = other.bundle.clone() {
if self.bundle.is_none() {
self.bundle = Some(bundle.clone());
}
self.bundle.as_mut().unwrap().merge(bundle);
}
if !other.opts.is_empty() {
self.opts = other.opts.clone();
}
Expand Down
16 changes: 14 additions & 2 deletions src/backend/aqua.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,11 @@ impl AquaBackend {
}
AquaChecksumType::Http => checksum.url(pkg, v)?,
};
let checksum_path = tv.download_path().join(format!("{filename}.checksum"));
let download_path = tv.download_path();
let checksum_path = download_path.join(format!("{filename}.checksum"));
HTTP.download_file(&url, &checksum_path, Some(&ctx.pr))
.await?;
self.cosign_checksums(ctx, pkg, v, tv, &checksum_path)
self.cosign_checksums(ctx, pkg, v, tv, &checksum_path, &download_path)
.await?;
let mut checksum_file = file::read_to_string(&checksum_path)?;
if checksum.file_format() == "regexp" {
Expand Down Expand Up @@ -514,6 +515,7 @@ impl AquaBackend {
v: &str,
tv: &ToolVersion,
checksum_path: &Path,
download_path: &Path,
) -> Result<()> {
if !Settings::get().aqua.cosign {
return Ok(());
Expand Down Expand Up @@ -553,6 +555,16 @@ impl AquaBackend {
cmd = cmd.arg("--certificate").arg(arg);
}
}
if let Some(bundle) = &cosign.bundle {
let url = bundle.arg(pkg, v)?;
if !url.is_empty() {
let filename = url.split('/').next_back().unwrap();
let bundle_path = download_path.join(filename);
HTTP.download_file(&url, &bundle_path, Some(&ctx.pr))
.await?;
cmd = cmd.arg("--bundle").arg(bundle_path);
}
}
for opt in cosign.opts(pkg, v)? {
cmd = cmd.arg(opt);
}
Expand Down
Loading