buildbot: allow failure messages to be sent to an alternate address
[packages/dph.git] / dph-buildbot / src / Args.hs
1 {-# LANGUAGE ScopedTypeVariables #-}
2
3 module Args
4 ( BuildArg(..)
5 , buildArgs)
6 where
7 import System.Console.ParseArgs
8
9 -- Command line args for the buildbot.
10 data BuildArg
11 = ArgHelp
12 | ArgVerbose
13
14 -- Automated builds
15 | ArgDaily
16 | ArgDailyNow
17 | ArgDailyTomorrow
18
19 -- Building GHC and libs.
20 | ArgScratchDir
21 | ArgGhcUnpack
22 | ArgGhcBuild
23 | ArgGhcUnpackBuild
24 | ArgGhcUse
25 | ArgLibs
26
27 -- Testing DPH and Repa
28 | ArgDoTestRepa
29 | ArgDoTestDPH
30 | ArgDoTestNoSlow
31 | ArgTestIterations
32 | ArgMailFrom
33 | ArgMailTo
34 | ArgMailFailTo
35 | ArgMailBanner
36 | ArgSendTestMail
37 | ArgWriteResults
38 | ArgWriteResultsStamped
39 | ArgUploadResults
40 | ArgAgainstResults
41 | ArgSwingFraction
42 deriving (Eq, Ord, Show)
43
44
45 buildArgs :: [Arg BuildArg]
46 buildArgs
47 = [ Arg { argIndex = ArgHelp
48 , argAbbr = Just 'h'
49 , argName = Just "help"
50 , argData = Nothing
51 , argDesc = "Print this usage help." }
52
53 , Arg { argIndex = ArgVerbose
54 , argAbbr = Just 'v'
55 , argName = Just "verbose"
56 , argData = Nothing
57 , argDesc = "Verbose logging of build commands." }
58
59 -- Automated builds
60 , Arg { argIndex = ArgDaily
61 , argAbbr = Nothing
62 , argName = Just "daily"
63 , argData = argDataOptional "time" ArgtypeString
64 , argDesc = "Run the build commands every day at this time. fmt: HH:MM:SS" }
65
66 , Arg { argIndex = ArgDailyNow
67 , argAbbr = Nothing
68 , argName = Just "now"
69 , argData = Nothing
70 , argDesc = "(opt. for --daily) Also run the build right now." }
71
72 , Arg { argIndex = ArgDailyTomorrow
73 , argAbbr = Nothing
74 , argName = Just "tomorrow"
75 , argData = Nothing
76 , argDesc = "(opt. for --daily) Run the first build tomorrow." }
77
78
79 -- Building GHC and libs.
80 , Arg { argIndex = ArgScratchDir
81 , argAbbr = Nothing
82 , argName = Just "scratch"
83 , argData = argDataOptional "dir" ArgtypeString
84 , argDesc = "For --ghc-unpack and --ghc-unpack-build, where to put the unpacked tree." }
85
86 , Arg { argIndex = ArgGhcUnpack
87 , argAbbr = Nothing
88 , argName = Just "ghc-unpack"
89 , argData = argDataOptional "file" ArgtypeString
90 , argDesc = "Unpack this GHC snapshot and update it from darcs.haskell.org." }
91
92 , Arg { argIndex = ArgGhcBuild
93 , argAbbr = Nothing
94 , argName = Just "ghc-build"
95 , argData = argDataOptional "dir" ArgtypeString
96 , argDesc = "Build an already unpacked and updated GHC snapshot." }
97
98 , Arg { argIndex = ArgGhcUnpackBuild
99 , argAbbr = Nothing
100 , argName = Just "ghc-unpack-build"
101 , argData = argDataOptional "file" ArgtypeString
102 , argDesc = "Unpack this GHC snapshot, update, and build it." }
103
104 , Arg { argIndex = ArgGhcUse
105 , argAbbr = Nothing
106 , argName = Just "ghc-use"
107 , argData = argDataOptional "dir" ArgtypeString
108 , argDesc = "Use the previously built GHC in this dir" }
109
110 , Arg { argIndex = ArgLibs
111 , argAbbr = Nothing
112 , argName = Just "ghc-libs"
113 , argData = argDataOptional "spec" ArgtypeString
114 , argDesc = "Install some libraries into the GHC build" }
115
116
117 -- Testing DPH and Repa
118 , Arg { argIndex = ArgDoTestDPH
119 , argAbbr = Nothing
120 , argName = Just "test-dph"
121 , argData = Nothing
122 , argDesc = "Run DPH regression tests." }
123
124 , Arg { argIndex = ArgDoTestRepa
125 , argAbbr = Nothing
126 , argName = Just "test-repa"
127 , argData = Nothing
128 , argDesc = "Run Repa regression tests." }
129
130 , Arg { argIndex = ArgDoTestNoSlow
131 , argAbbr = Nothing
132 , argName = Just "test-noslow"
133 , argData = Nothing
134 , argDesc = "Run NoSlow regression tests." }
135
136 , Arg { argIndex = ArgTestIterations
137 , argAbbr = Just 'i'
138 , argName = Just "iterations"
139 , argData = argDataDefaulted "int" ArgtypeInt 1
140 , argDesc = "(opt. for test modes) Number of times to run each benchmark." }
141
142 , Arg { argIndex = ArgAgainstResults
143 , argAbbr = Just 'a'
144 , argName = Just "against"
145 , argData = argDataOptional "file" ArgtypeString
146 , argDesc = "(opt. for test modes) Print running comparison against results in this file." }
147
148 , Arg { argIndex = ArgSwingFraction
149 , argAbbr = Just 's'
150 , argName = Just "swing"
151 , argData = argDataOptional "fraction" ArgtypeDouble
152 , argDesc = "(opt. for test modes) Treat a fractional swing vs the baseline as interesting (eg 0.1)" }
153
154 , Arg { argIndex = ArgWriteResults
155 , argAbbr = Just 'w'
156 , argName = Just "write"
157 , argData = argDataOptional "file" ArgtypeString
158 , argDesc = "(opt. for test modes) Write results to this file." }
159
160 , Arg { argIndex = ArgWriteResultsStamped
161 , argAbbr = Just 'p'
162 , argName = Just "write-stamped"
163 , argData = argDataOptional "file" ArgtypeString
164 , argDesc = "(opt. for test modes) ... appending a time stamp to the name." }
165
166 , Arg { argIndex = ArgUploadResults
167 , argAbbr = Just 'u'
168 , argName = Just "upload"
169 , argData = argDataOptional "scp-path" ArgtypeString
170 , argDesc = "(opt. for test modes) ... and scp the results to this path." }
171
172 , Arg { argIndex = ArgMailFrom
173 , argAbbr = Nothing
174 , argName = Just "mail-from"
175 , argData = argDataOptional "address" ArgtypeString
176 , argDesc = "(opt. for test modes) Send test results from this address." }
177
178 , Arg { argIndex = ArgMailTo
179 , argAbbr = Nothing
180 , argName = Just "mail-to"
181 , argData = argDataOptional "address" ArgtypeString
182 , argDesc = "(opt. for test modes) ... to this address." }
183
184 , Arg { argIndex = ArgMailFailTo
185 , argAbbr = Nothing
186 , argName = Just "mail-fail-to"
187 , argData = argDataOptional "address" ArgtypeString
188 , argDesc = "(opt. for test modes) ... but send failure messages to this other address." }
189
190 , Arg { argIndex = ArgMailBanner
191 , argAbbr = Nothing
192 , argName = Just "mail-banner"
193 , argData = argDataOptional "file" ArgtypeString
194 , argDesc = "(opt. for test modes) ... appending the banner to the front of the message." }
195
196 -- Setup debugging
197 , Arg { argIndex = ArgSendTestMail
198 , argAbbr = Nothing
199 , argName = Just "send-test-mail"
200 , argData = Nothing
201 , argDesc = "Send a test mail to check mailer configuration." }
202 ]