-
Notifications
You must be signed in to change notification settings - Fork 0
/
.sf.dhall
112 lines (95 loc) · 3.42 KB
/
.sf.dhall
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
let Zuul =
env:DHALL_ZUUL
? https://raw.githubusercontent.com/softwarefactory-project/dhall-zuul/0.1.0/package.dhall
sha256:40c8a33ee920d12ac4b27571031e27722b4ef63771abaaaca471bc08654c31dc
let Prelude =
env:DHALL_PRELUDE
? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v17.0.0/Prelude/package.dhall
sha256:10db3c919c25e9046833df897a8ffe2701dc390fa0893d958c3430524be5a43e
let nodeset =
Zuul.Nodeset::{
, name = Some "shake-factory-latest"
, nodes = [ { name = "container", label = "zuul-worker-haskell-ghc9" } ]
}
let hlint =
{ name = Some "shake-factory-hlint"
, parent = Some "hlint"
, nodeset = Some (Zuul.Nodeset.Name "shake-factory-latest")
}
let base-vars = [ { mapKey = "shake_target", mapValue = Zuul.Vars.string "" } ]
let base =
{ name = Some "shake-factory-base"
, abstract = Some True
, nodeset = Some (Zuul.Nodeset.Name "shake-factory-latest")
, run = Some "playbooks/shake.yaml"
, vars = Some (Zuul.Vars.object base-vars)
, roles = Some [ { zuul = "zuul-jobs" } ]
, required-projects = Some
[ { name = "softwarefactory-project.io/software-factory/shake-factory" }
]
}
let test =
{ name = Some "shake-factory-test", parent = Some "shake-factory-base" }
let docs-vars =
toMap
{ shake_target = Zuul.Vars.string "docs"
, docs_dir = Zuul.Vars.string "build/docs"
}
let docs =
{ name = Some "shake-factory-docs"
, parent = Some "shake-factory-base"
, post-run = Some [ "playbooks/docs.yaml" ]
, vars = Some (Zuul.Vars.object docs-vars)
}
let publish-docs =
docs
// base
// { name = Some "shake-factory-publish-docs"
, abstract = None Bool
, parent = Some "docssf-publish"
, vars = Some (Zuul.Vars.object (base-vars # docs-vars))
}
let gate-jobs =
[ Zuul.Job::hlint, Zuul.Job::base, Zuul.Job::test, Zuul.Job::docs ]
let post-jobs = [ Zuul.Job::publish-docs ]
let mkPipeline =
\(gate-jobs : List Zuul.Job.Type) ->
let ci-pipeline =
Zuul.Project.Pipeline
( Zuul.ProjectPipeline.mkSimpleJobs
( Prelude.List.filter
Zuul.Job.Type
( \(job : Zuul.Job.Type) ->
Prelude.Bool.not
(Prelude.Optional.default Bool False job.abstract)
)
gate-jobs
)
)
let post-pipeline =
Zuul.Project.Pipeline
(Zuul.ProjectPipeline.mkSimpleJobs post-jobs)
in [ toMap
{ check = ci-pipeline
, gate = ci-pipeline
, post = post-pipeline
}
]
let shakeTest =
\(required-projects : List Text) ->
let required-projects-name =
Prelude.List.map
Text
{ name : Text }
(\(name : Text) -> { name })
required-projects
in Zuul.Job::( test
// { required-projects = Some required-projects-name }
)
in { zuul =
Zuul.Nodeset.wrap [ nodeset ]
# Zuul.Job.wrap (gate-jobs # post-jobs)
# Zuul.Project.wrap (mkPipeline gate-jobs)
, mkPipeline
, shakeTest
}