builder: convert to io.launcher

db4
Eduardo Cavazos 2008-02-04 21:26:59 -06:00
parent 6c3505aba9
commit 1f66e8173f
1 changed files with 82 additions and 69 deletions

View File

@ -1,7 +1,7 @@
USING: kernel io io.files io.launcher tools.deploy.backend USING: kernel io io.files io.launcher hashtables tools.deploy.backend
system namespaces sequences splitting math.parser system continuations namespaces sequences splitting math.parser
unix prettyprint tools.time calendar bake vars ; prettyprint tools.time calendar bake vars http.client ;
IN: builder IN: builder
@ -19,15 +19,19 @@ IN: builder
SYMBOL: builder-recipients SYMBOL: builder-recipients
: quote ( str -- str ) "'" swap "'" 3append ;
: email-file ( subject file -- ) : email-file ( subject file -- )
`{ `{
"cat" , { +stdin+ , }
"| mutt -s" ,[ quote ] { +arguments+ { "mutt" "-s" , %[ builder-recipients get ] } }
"-x" %[ builder-recipients get ] }
} >hashtable run-process drop ;
" " join system drop ;
: email-string ( subject -- )
`{ "mutt" "-s" , %[ builder-recipients get ] }
<process-stream>
dup
dispose
process-stream-process wait-for-process drop ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@ -41,74 +45,83 @@ VAR: stamp
: build ( -- ) : build ( -- )
datestamp >stamp datestamp >stamp
"/builds/factor" cd "/builds/factor" cd
"git pull git://factorcode.org/git/factor.git" system
0 =
[ ]
[
"builder: git pull" "/dev/null" email-file
"builder: git pull" throw
]
if
"/builds/" stamp> append make-directory { "git" "pull" "--no-summary" "git://factorcode.org/git/factor.git" }
"/builds/" stamp> append cd run-process process-status
"git clone /builds/factor" system drop 0 =
[ ]
[
"builder: git pull" email-string
"builder: git pull" throw
]
if
"factor" cd "/builds/" stamp> append make-directory
"/builds/" stamp> append cd
{ "git" "show" } <process-stream> { "git" "clone" "/builds/factor" } run-process drop
[ readln ] with-stream
" " split second
"../git-id" <file-writer> [ print ] with-stream
"make clean" system drop "factor" cd
"make " target " > ../compile-log" 3append system { "git" "show" } <process-stream>
0 = [ readln ] with-stream
[ ] " " split second
[ "../git-id" <file-writer> [ print ] with-stream
"builder: vm compile" "../compile-log" email-file
"builder: vm compile" throw
] if
"wget http://factorcode.org/images/latest/" boot-image-name append system { "make" "clean" } run-process drop
0 =
[ ]
[
"builder: image download" "/dev/null" email-file
"builder: image download" throw
] if
[ `{
"./factor -i=" boot-image-name " -no-user-init > ../boot-log" { +arguments+ { "make" ,[ target ] } }
3append { +stdout+ "../compile-log" }
system { +stderr+ +stdout+ }
] }
benchmark nip >hashtable run-process process-status
"../boot-time" <file-writer> [ . ] with-stream 0 =
0 = [ ]
[ ] [
[ "builder: vm compile" "../compile-log" email-file
"builder: bootstrap" "../boot-log" email-file "builder: vm compile" throw
"builder: bootstrap" throw ] if
] if
[ [ "http://factorcode.org/images/latest/" boot-image-name append download ]
"./factor -e='USE: tools.browser load-everything' > ../load-everything-log" [ "builder: image download" email-string ]
system recover
] benchmark nip
"../load-everything-time" <file-writer> [ . ] with-stream
0 =
[ ]
[
"builder: load-everything" "../load-everything-log" email-file
"builder: load-everything" throw
] if
; `{
{ +arguments+ {
"./factor"
,[ "-i=" boot-image-name append ]
"-no-user-init"
} }
{ +stdout+ "../boot-log" }
{ +stderr+ +stdout+ }
}
>hashtable
[ run-process process-status ]
benchmark nip "../boot-time" <file-writer> [ . ] with-stream
0 =
[ ]
[
"builder: bootstrap" "../boot-log" email-file
"builder: bootstrap" throw
] if
`{
{ +arguments+ { "./factor" "-e=USE: tools.browser load-everything" } }
{ +stdout+ "../load-everything-log" }
{ +stderr+ +stdout+ }
}
>hashtable [ run-process process-status ] benchmark nip
"../load-everything-time" <file-writer> [ . ] with-stream
0 =
[ ]
[
"builder: load-everything" "../load-everything-log" email-file
"builder: load-everything" throw
] if ;
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!