Skip to content

Commit

Permalink
move mg-admin-client to clients directory
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgoodfellow committed Oct 10, 2023
1 parent f430aaf commit 737adcf
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ members = [
"clients/dpd-client",
"clients/gateway-client",
"clients/installinator-artifact-client",
"clients/mg-admin-client",
"clients/nexus-client",
"clients/oxide-client",
"clients/oximeter-client",
Expand All @@ -21,7 +22,6 @@ members = [
"dev-tools/omicron-dev",
"dev-tools/thing-flinger",
"dev-tools/xtask",
"mg-admin-client",
"dns-server",
"end-to-end-tests",
"gateway-cli",
Expand Down Expand Up @@ -83,13 +83,13 @@ default-members = [
"clients/oximeter-client",
"clients/sled-agent-client",
"clients/wicketd-client",
"clients/mg-admin-client",
"common",
"dev-tools/crdb-seed",
"dev-tools/omdb",
"dev-tools/omicron-dev",
"dev-tools/thing-flinger",
"dev-tools/xtask",
"mg-admin-client",
"dns-server",
"gateway-cli",
"gateway-test-utils",
Expand Down Expand Up @@ -228,7 +228,7 @@ macaddr = { version = "1.0.1", features = ["serde_std"] }
mime_guess = "2.0.4"
mockall = "0.11"
newtype_derive = "0.1.6"
mg-admin-client = { path = "mg-admin-client" }
mg-admin-client = { path = "clients/mg-admin-client" }
nexus-client = { path = "clients/nexus-client" }
nexus-db-model = { path = "nexus/db-model" }
nexus-db-queries = { path = "nexus/db-queries" }
Expand Down
File renamed without changes.
15 changes: 8 additions & 7 deletions mg-admin-client/build.rs → clients/mg-admin-client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,23 @@ use std::path::Path;

fn main() -> Result<()> {
// Find the current maghemite repo commit from our package manifest.
let manifest = fs::read_to_string("../package-manifest.toml")
.context("failed to read ../package-manifest.toml")?;
println!("cargo:rerun-if-changed=../package-manifest.toml");
let manifest = fs::read_to_string("../../package-manifest.toml")
.context("failed to read ../../package-manifest.toml")?;
println!("cargo:rerun-if-changed=../../package-manifest.toml");

let config: Config = toml::from_str(&manifest)
.context("failed to parse ../package-manifest.toml")?;
.context("failed to parse ../../package-manifest.toml")?;
let mg = config
.packages
.get("mgd")
.context("missing mgd package in ../package-manifest.toml")?;
.context("missing mgd package in ../../package-manifest.toml")?;

let local_path = match &mg.source {
PackageSource::Prebuilt { commit, .. } => {
// Report a relatively verbose error if we haven't downloaded the requisite
// openapi spec.
let local_path = format!("../out/downloads/mg-admin-{commit}.json");
let local_path =
format!("../../out/downloads/mg-admin-{commit}.json");
if !Path::new(&local_path).exists() {
bail!("{local_path} doesn't exist; rerun `tools/ci_download_maghemite_openapi` (after updating `tools/maghemite_mg_openapi_version` if the maghemite commit in package-manifest.toml has changed)");
}
Expand All @@ -41,7 +42,7 @@ fn main() -> Result<()> {

PackageSource::Manual => {
let local_path =
"../out/downloads/mg-admin-manual.json".to_string();
"../../out/downloads/mg-admin-manual.json".to_string();
if !Path::new(&local_path).exists() {
bail!("{local_path} doesn't exist, please copy manually built mg-admin.json there!");
}
Expand Down
File renamed without changes.

0 comments on commit 737adcf

Please sign in to comment.