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
5 changes: 3 additions & 2 deletions src/config/imp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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")]
Expand Down Expand Up @@ -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")]
Expand Down
12 changes: 6 additions & 6 deletions src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand All @@ -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,
Expand Down Expand Up @@ -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
Expand All @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

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.
///
/// 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<String, String>);

Expand Down
Loading