1 ! Copyright (C) 2009, 2011 Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors continuations debugger http.client io
4 io.encodings.utf8 io.files kernel make mason.common mason.config
5 mason.email mason.twitter namespaces sequences ;
8 : status-notify? ( -- ? )
10 target-variant get not and ;
12 : status-params ( report arg message -- assoc )
14 short-host-name "host-name" ,,
15 target-cpu get "target-cpu" ,,
16 target-os get "target-os" ,,
17 status-secret get "secret" ,,
23 : status-notify ( report arg message -- )
27 _ _ _ status-params status-url get
31 "STATUS NOTIFY FAILED:" print-timestamp
36 : notify-heartbeat ( -- )
37 f f "heartbeat" status-notify ;
40 f f "idle" status-notify ;
42 : notify-begin-build ( git-id -- )
43 [ "Starting build of GIT ID " prepend print-timestamp ]
44 [ f swap "git-id" status-notify ]
47 : notify-make-vm ( -- )
48 "Compiling VM" print-timestamp
49 f f "make-vm" status-notify ;
52 "Bootstrapping" print-timestamp
53 f f "boot" status-notify ;
56 "Running tests" print-timestamp
57 f f "test" status-notify ;
59 : notify-report ( status -- )
60 [ name>> "Build finished with status: " prepend print-timestamp ]
62 [ "report" utf8 file-contents ] dip
63 [ name>> "report" status-notify ] [ email-report ] 2bi
66 : notify-upload ( -- )
67 f f "upload" status-notify ;
69 : notify-finish ( -- )
70 f f "finish" status-notify ;
72 : notify-release ( archive-name -- )
73 [ "Uploaded " prepend [ print-timestamp ] [ mason-tweet ] bi ]
74 [ f swap "release" status-notify ]