1 ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: accessors calendar continuations debugger io
4 io.directories io.pathnames io.sockets io.streams.string kernel
5 make mason.build mason.common mason.config mason.disk
6 mason.email mason.notify mason.updates namespaces prettyprint
10 : heartbeat-loop ( -- )
15 : fatal-error-body ( error callstack -- string )
17 "Fatal error on " write host-name print nl
18 [ error. ] [ callstack. ] bi*
19 ] with-string-writer ;
21 : build-loop-error ( error callstack -- )
28 builds-dir get make-directories
32 should-build? [ do-build ] [ 5 minutes sleep ] if
35 error-continuation get call>> build-loop-error
41 : check-host ( user host -- )
44 "resource:LICENSE.txt" absolute-path canonicalize-path ,
46 ] { } make short-running-process ;
49 branch-username get branch-host get check-host
50 package-username get package-host get check-host
51 image-username get image-host get check-host
53 docs-username get docs-host get check-host
58 [ heartbeat-loop ] "Heartbeat loop" spawn
59 [ build-loop ] "Build loop" spawn