diff options
author | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-14 21:18:17 +0100 |
---|---|---|
committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-03-14 21:39:14 +0100 |
commit | 3bb1c548e2696abd3f7dc2d7b9fbc27ceb490c36 (patch) | |
tree | 67cb5d9f33483fe5393bfda89b10b63c5420e962 /src/Job/Types.hs | |
parent | f8b2df887d3847041a81b00dbea70db30b07eb92 (diff) |
Evaluate repo definitions
Diffstat (limited to 'src/Job/Types.hs')
-rw-r--r-- | src/Job/Types.hs | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/src/Job/Types.hs b/src/Job/Types.hs index 3f6f1f0..a16ba1d 100644 --- a/src/Job/Types.hs +++ b/src/Job/Types.hs @@ -8,14 +8,21 @@ import System.Process import Repo -data Job = Job +data Declared +data Evaluated + +data Job' d = Job { jobName :: JobName - , jobCheckout :: [ ( Maybe RepoName, Maybe FilePath ) ] + , jobContainingCheckout :: [ JobCheckout ] + , jobOtherCheckout :: [ ( JobRepo d, JobCheckout ) ] , jobRecipe :: [ CreateProcess ] , jobArtifacts :: [ ( ArtifactName, CreateProcess ) ] , jobUses :: [ ( JobName, ArtifactName ) ] } +type Job = Job' Evaluated +type DeclaredJob = Job' Declared + data JobName = JobName Text deriving (Eq, Ord, Show) @@ -26,15 +33,28 @@ textJobName :: JobName -> Text textJobName (JobName name) = name +data JobRepo d where + DeclaredJobRepo :: RepoName -> JobRepo Declared + EvaluatedJobRepo :: Repo -> JobRepo Evaluated + +data JobCheckout = JobCheckout + { jcSubtree :: Maybe FilePath + , jcDestination :: Maybe FilePath + } + + data ArtifactName = ArtifactName Text deriving (Eq, Ord, Show) -data JobSet = JobSet +data JobSet' d = JobSet { jobsetCommit :: Maybe Commit - , jobsetJobsEither :: Either String [ Job ] + , jobsetJobsEither :: Either String [ Job' d ] } +type JobSet = JobSet' Evaluated +type DeclaredJobSet = JobSet' Declared + jobsetJobs :: JobSet -> [ Job ] jobsetJobs = either (const []) id . jobsetJobsEither |