Enable explicitly configured private artifact storage for authenticated production releases
This commit is contained in:
@@ -123,11 +123,13 @@ pub fn store() -> Result<UpdateArtifacts, Error> {
|
||||
if !metadata.is_file() || metadata.permissions().mode() & 0o077 != 0 {
|
||||
return Err(fail("AGENT_UPDATE_NOT_CONFIGURED"));
|
||||
}
|
||||
let profile = std::env::var("RMM_PROFILE").unwrap_or_default();
|
||||
Ok(UpdateArtifacts::new(
|
||||
&std::env::var("RMM_PROFILE").unwrap_or_default(),
|
||||
&profile,
|
||||
match std::env::var_os("RMM_AGENT_UPDATE_ARTIFACT_DIR") {
|
||||
Some(value) if FsPath::new(&value).is_absolute() => value.into(),
|
||||
Some(_) => return Err(fail("AGENT_UPDATE_NOT_CONFIGURED")),
|
||||
None if profile != "development" => return Err(fail("AGENT_UPDATE_NOT_CONFIGURED")),
|
||||
None => path
|
||||
.parent()
|
||||
.ok_or_else(|| fail("AGENT_UPDATE_NOT_CONFIGURED"))?
|
||||
|
||||
Reference in New Issue
Block a user