pub mod core;
pub mod error;
pub mod platform;
pub mod scope;
pub mod source;
pub mod stage;
pub mod version;
pub use core::{Contract, detect_language_by_files};
pub use error::ContractError;
pub use platform::{Pipeline, Platform, Registry, SourceControl};
pub use scope::{BuildTool, Language, Scope};
pub use source::{Source, SourceType, VersionSource};
pub use stage::{Stage, StageBuild, StageRelease, StageTest};
pub use version::{normalize_version, read_all_config_versions, validate_version};
use std::path::Path;
pub fn load(repo_path: &Path) -> Result<Contract, ContractError> {
let path = repo_path.join(".quanttide/devops/contract.yaml");
let content = std::fs::read_to_string(&path)?;
load_from_str(&content)
}
pub fn load_from_str(s: &str) -> Result<Contract, ContractError> {
serde_yaml::from_str::<Contract>(s).map_err(|e| ContractError::Parse(e.to_string()))
}