quanttide_devops/contract/
mod.rs1pub mod error;
5pub mod model;
6pub mod version;
7
8pub use error::ContractError;
9pub use model::{
10 BuildTool, Contract, Language, Pipeline, Platform, Registry, Scope, Source, SourceControl,
11 SourceType, Stage, StageBuild, StageRelease, StageTest, VersionSource,
12 detect_language_by_files,
13};
14pub use version::{normalize_version, read_all_config_versions, validate_version};
15
16use std::path::Path;
17
18pub fn load(repo_path: &Path) -> Result<Contract, ContractError> {
20 let path = repo_path.join(".quanttide/devops/contract.yaml");
21 let content = std::fs::read_to_string(&path)?;
22 load_from_str(&content)
23}
24
25pub fn load_from_str(s: &str) -> Result<Contract, ContractError> {
27 serde_yaml::from_str::<Contract>(s).map_err(|e| ContractError::Parse(e.to_string()))
28}