diff --git a/crates/acme/Cargo.toml b/crates/acme/Cargo.toml index 11be091f..61fbc3e7 100644 --- a/crates/acme/Cargo.toml +++ b/crates/acme/Cargo.toml @@ -17,16 +17,9 @@ crate-type = ["cdylib", "rlib"] test = true [features] -default = ["clusters", "conduits", "core"] -full = [ - "clusters", - "compilers", - "conduits", - "core", - "extras", - "gateways", - "pipelines", -] +default = ["core"] +full = ["clusters", "conduits", "core", "compilers", "extras", "gateways", "pipelines",] + core = ["acme-core"] extras = [] diff --git a/crates/pipelines/src/lib.rs b/crates/pipelines/src/lib.rs index 86e6b31e..dd89d951 100644 --- a/crates/pipelines/src/lib.rs +++ b/crates/pipelines/src/lib.rs @@ -3,8 +3,12 @@ Contrib: FL03 Description: ... Summary ... */ -pub use self::{pipeline::*, primitives::*, utils::*}; +pub use self::{pipeline::*, primitives::*, stages::*, utils::*}; pub(crate) mod pipeline; -pub(crate) mod primitives; +pub(crate) mod stages; pub(crate) mod utils; + +pub(crate) mod primitives { + pub const DEFAULT_WORKDIR: &str = "."; +} diff --git a/crates/pipelines/src/pipeline.rs b/crates/pipelines/src/pipeline.rs index f6f65386..45abf14a 100644 --- a/crates/pipelines/src/pipeline.rs +++ b/crates/pipelines/src/pipeline.rs @@ -5,16 +5,30 @@ PipelineStage: Stages in the build process which specify when a particular hook will execute */ +use crate::PipelineStage; + +use scsys::prelude::{Message, Timestamp}; use serde::{Deserialize, Serialize}; +use std::sync::Arc; + +#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize)] +pub struct Pipeline { + pub message: Message, + pub name: String, + pub stage: PipelineStage, + pub timestamp: i64, +} -#[allow(clippy::enum_variant_names)] -#[derive( - Clone, Copy, Debug, Default, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, -)] -#[serde(rename_all = "snake_case")] -pub enum PipelineStage { - PreBuild, - #[default] - Build, - PostBuild, +impl Pipeline { + pub fn new(message: Option, name: String) -> Self { + let message = message.unwrap_or_default(); + let stage = PipelineStage::PreBuild; + let timestamp = Timestamp::default().into(); + Self { + message, + name, + stage, + timestamp, + } + } } diff --git a/crates/pipelines/src/primitives.rs b/crates/pipelines/src/primitives.rs deleted file mode 100644 index d8f73b8b..00000000 --- a/crates/pipelines/src/primitives.rs +++ /dev/null @@ -1,13 +0,0 @@ -/* - Appellation: primitives - Contrib: FL03 - Description: ... Summary ... -*/ -pub use self::{constants::*, types::*}; - -pub(crate) mod constants { - - pub const DEFAULT_WORKDIR: &str = "."; -} - -pub(crate) mod types {} diff --git a/crates/pipelines/src/stages.rs b/crates/pipelines/src/stages.rs new file mode 100644 index 00000000..38cc3d0f --- /dev/null +++ b/crates/pipelines/src/stages.rs @@ -0,0 +1,21 @@ +/* + Appellation: pipeline + Contrib: FL03 + Description: + Stages + - +*/ +use serde::{Deserialize, Serialize}; + +#[allow(clippy::enum_variant_names)] +#[derive( + Clone, Copy, Debug, Default, Deserialize, Eq, Hash, Ord, PartialEq, PartialOrd, Serialize, +)] +#[serde(rename_all = "snake_case")] +pub enum PipelineStage { + PreBuild = 0, + #[default] + Build = 1, + + PostBuild = -1, +} diff --git a/crates/pipelines/src/utils.rs b/crates/pipelines/src/utils.rs index add2b1c9..fb8b2f29 100644 --- a/crates/pipelines/src/utils.rs +++ b/crates/pipelines/src/utils.rs @@ -4,13 +4,4 @@ Description: ... Summary ... */ -/// Remove the first and last charecters of a string -pub fn fnl_remove(data: T) -> String { - let data = data.to_string(); - let mut chars = data.chars(); - chars.next(); - chars.next_back(); - chars.as_str().to_string() -} - pub fn remove_dir_all() {}