2009-04-17 21:59:59 -04:00
|
|
|
! Copyright (C) 2009 Slava Pestov.
|
|
|
|
! See http://factorcode.org/license.txt for BSD license.
|
|
|
|
USING: arrays accessors io io.sockets io.encodings.utf8 io.files
|
|
|
|
io.launcher kernel make mason.config mason.common mason.email
|
2009-05-10 17:40:19 -04:00
|
|
|
mason.twitter namespaces sequences prettyprint fry ;
|
2009-04-17 21:59:59 -04:00
|
|
|
IN: mason.notify
|
|
|
|
|
|
|
|
: status-notify ( input-file args -- )
|
|
|
|
status-host get [
|
|
|
|
[
|
|
|
|
"ssh" , status-host get , "-l" , status-username get ,
|
|
|
|
"./mason-notify" ,
|
2009-05-21 20:19:12 -04:00
|
|
|
short-host-name ,
|
2009-04-17 21:59:59 -04:00
|
|
|
target-cpu get ,
|
|
|
|
target-os get ,
|
|
|
|
] { } make prepend
|
2009-05-10 17:40:19 -04:00
|
|
|
[ 5 ] 2dip '[
|
|
|
|
<process>
|
2009-05-21 01:08:43 -04:00
|
|
|
_ >>stdin
|
2009-05-11 23:04:54 -04:00
|
|
|
_ >>command
|
2009-05-12 17:52:43 -04:00
|
|
|
short-running-process
|
2009-05-10 17:40:19 -04:00
|
|
|
] retry
|
2009-04-17 21:59:59 -04:00
|
|
|
] [ 2drop ] if ;
|
|
|
|
|
|
|
|
: notify-begin-build ( git-id -- )
|
|
|
|
[ "Starting build of GIT ID " write print flush ]
|
|
|
|
[ f swap "git-id" swap 2array status-notify ]
|
|
|
|
bi ;
|
|
|
|
|
|
|
|
: notify-make-vm ( -- )
|
|
|
|
"Compiling VM" print flush
|
|
|
|
f { "make-vm" } status-notify ;
|
|
|
|
|
|
|
|
: notify-boot ( -- )
|
|
|
|
"Bootstrapping" print flush
|
|
|
|
f { "boot" } status-notify ;
|
|
|
|
|
|
|
|
: notify-test ( -- )
|
|
|
|
"Running tests" print flush
|
|
|
|
f { "test" } status-notify ;
|
|
|
|
|
|
|
|
: notify-report ( status -- )
|
2009-04-25 17:52:23 -04:00
|
|
|
[ "Build finished with status: " write . flush ]
|
2009-04-17 21:59:59 -04:00
|
|
|
[
|
2009-05-13 19:19:30 -04:00
|
|
|
[ "report" ] dip
|
|
|
|
[ [ utf8 file-contents ] dip email-report ]
|
|
|
|
[ "report" swap name>> 2array status-notify ]
|
|
|
|
2bi
|
2009-04-17 21:59:59 -04:00
|
|
|
] bi ;
|
|
|
|
|
|
|
|
: notify-release ( archive-name -- )
|
2009-05-21 01:08:43 -04:00
|
|
|
[ "Uploaded " prepend [ print flush ] [ mason-tweet ] bi ]
|
|
|
|
[ f swap "release" swap 2array status-notify ]
|
|
|
|
bi ;
|