diff --git a/src/config/imp.rs b/src/config/imp.rs index d020b87..ab96e71 100644 --- a/src/config/imp.rs +++ b/src/config/imp.rs @@ -7,6 +7,7 @@ use crate::package::{Package, PackageOutput, PackageSource}; use crate::target::TargetMap; use serde_derive::Deserialize; +use serde_derive::Serialize; use std::collections::BTreeMap; use std::path::Path; use thiserror::Error; @@ -101,7 +102,7 @@ impl<'a> Iterator for PackageDependencyIter<'a> { } /// Describes the configuration for a set of packages. -#[derive(Clone, Deserialize, Debug)] +#[derive(Clone, Deserialize, Serialize, Debug)] pub struct Config { /// Packages to be built and installed. #[serde(default, rename = "package")] @@ -139,7 +140,7 @@ impl Config { } /// Configuration for targets, including preset configuration. -#[derive(Clone, Deserialize, Debug, Default)] +#[derive(Clone, Deserialize, Serialize, Debug, Default)] pub struct TargetConfig { /// Preset configuration for targets. #[serde(default, rename = "preset")] diff --git a/src/package.rs b/src/package.rs index d62e6a2..cc624ba 100644 --- a/src/package.rs +++ b/src/package.rs @@ -78,7 +78,7 @@ pub struct PrebuiltBlob { } /// Describes the origin of an externally-built package. -#[derive(Clone, Deserialize, Debug, PartialEq)] +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] #[serde(tag = "type", rename_all = "lowercase")] pub enum PackageSource { /// Describes a package which should be assembled locally. @@ -149,7 +149,7 @@ impl PackageSource { } /// Describes the output format of the package. -#[derive(Deserialize, Debug, Clone, PartialEq)] +#[derive(Deserialize, Serialize, Debug, Clone, PartialEq)] #[serde(tag = "type", rename_all = "lowercase")] pub enum PackageOutput { /// A complete zone image, ready to be deployed to the target. @@ -166,7 +166,7 @@ pub enum PackageOutput { } /// A single package. -#[derive(Clone, Deserialize, Debug, PartialEq)] +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] pub struct Package { /// The name of the service name to be used on the target OS. pub service_name: ServiceName, @@ -840,7 +840,7 @@ impl Package { } /// Describes configuration for a package which contains a Rust binary. -#[derive(Clone, Deserialize, Debug, PartialEq)] +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] pub struct RustPackage { /// The name of the compiled binary to be used. // TODO: Could be extrapolated to "produced build artifacts", we don't @@ -864,7 +864,7 @@ impl RustPackage { } /// A string which can be modified with key-value pairs. -#[derive(Clone, Deserialize, Debug, PartialEq)] +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] pub struct InterpolatedString(String); impl InterpolatedString { @@ -903,7 +903,7 @@ impl InterpolatedString { /// /// These paths may require target-specific interpretation before being /// transformed to an actual [MappedPath]. -#[derive(Clone, Deserialize, Debug, PartialEq)] +#[derive(Clone, Deserialize, Serialize, Debug, PartialEq)] pub struct InterpolatedMappedPath { /// Source path. pub from: InterpolatedString, diff --git a/src/target.rs b/src/target.rs index 4b19c32..67ccda0 100644 --- a/src/target.rs +++ b/src/target.rs @@ -4,6 +4,7 @@ use crate::package::Package; use serde::Deserialize; +use serde::Serialize; use std::collections::BTreeMap; /// Describes what platform and configuration we're trying to deploy on. @@ -11,7 +12,7 @@ use std::collections::BTreeMap; /// For flexibility, this is an arbitrary key-value map without any attached /// semantics to particular keys. Those semantics are provided by the consumers /// of this tooling within omicron. -#[derive(Clone, Debug, Default, PartialEq, Deserialize)] +#[derive(Clone, Debug, Default, PartialEq, Deserialize, Serialize)] #[serde(transparent)] pub struct TargetMap(pub BTreeMap);