Retry uploads etc up to 5 times so that we don't lose a good binary if network is flaky; put git id in subject
parent
47b22b6df5
commit
f4a134892c
|
@ -1,9 +1,9 @@
|
||||||
! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov.
|
! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: arrays kernel calendar io.directories io.encodings.utf8
|
USING: arrays kernel calendar io.directories io.encodings.utf8
|
||||||
io.files io.launcher mason.child mason.cleanup mason.common
|
io.files io.launcher namespaces prettyprint mason.child mason.cleanup
|
||||||
mason.help mason.release mason.report mason.email mason.notify
|
mason.common mason.help mason.release mason.report mason.email
|
||||||
namespaces prettyprint ;
|
mason.notify ;
|
||||||
IN: mason.build
|
IN: mason.build
|
||||||
|
|
||||||
QUALIFIED: continuations
|
QUALIFIED: continuations
|
||||||
|
@ -19,7 +19,10 @@ QUALIFIED: continuations
|
||||||
|
|
||||||
: begin-build ( -- )
|
: begin-build ( -- )
|
||||||
"factor" [ git-id ] with-directory
|
"factor" [ git-id ] with-directory
|
||||||
[ "git-id" to-file ] [ notify-begin-build ] bi ;
|
[ "git-id" to-file ]
|
||||||
|
[ current-git-id set ]
|
||||||
|
[ notify-begin-build ]
|
||||||
|
tri ;
|
||||||
|
|
||||||
: build ( -- )
|
: build ( -- )
|
||||||
create-build-dir
|
create-build-dir
|
||||||
|
|
|
@ -4,9 +4,12 @@ USING: kernel namespaces sequences splitting system accessors
|
||||||
math.functions make io io.files io.pathnames io.directories
|
math.functions make io io.files io.pathnames io.directories
|
||||||
io.directories.hierarchy io.launcher io.encodings.utf8 prettyprint
|
io.directories.hierarchy io.launcher io.encodings.utf8 prettyprint
|
||||||
combinators.short-circuit parser combinators calendar
|
combinators.short-circuit parser combinators calendar
|
||||||
calendar.format arrays mason.config locals system debugger ;
|
calendar.format arrays mason.config locals system debugger fry
|
||||||
|
continuations ;
|
||||||
IN: mason.common
|
IN: mason.common
|
||||||
|
|
||||||
|
SYMBOL: current-git-id
|
||||||
|
|
||||||
ERROR: output-process-error output process ;
|
ERROR: output-process-error output process ;
|
||||||
|
|
||||||
M: output-process-error error.
|
M: output-process-error error.
|
||||||
|
@ -35,15 +38,19 @@ M: unix really-delete-tree delete-tree ;
|
||||||
<process>
|
<process>
|
||||||
swap >>command
|
swap >>command
|
||||||
15 minutes >>timeout
|
15 minutes >>timeout
|
||||||
|
+closed+ >>stdin
|
||||||
try-output-process ;
|
try-output-process ;
|
||||||
|
|
||||||
|
: retry ( n quot -- )
|
||||||
|
'[ drop @ f ] attempt-all drop ; inline
|
||||||
|
|
||||||
:: upload-safely ( local username host remote -- )
|
:: upload-safely ( local username host remote -- )
|
||||||
[let* | temp [ remote ".incomplete" append ]
|
[let* | temp [ remote ".incomplete" append ]
|
||||||
scp-remote [ { username "@" host ":" temp } concat ]
|
scp-remote [ { username "@" host ":" temp } concat ]
|
||||||
scp [ scp-command get ]
|
scp [ scp-command get ]
|
||||||
ssh [ ssh-command get ] |
|
ssh [ ssh-command get ] |
|
||||||
{ scp local scp-remote } short-running-process
|
5 [ { scp local scp-remote } short-running-process ] retry
|
||||||
{ ssh host "-l" username "mv" temp remote } short-running-process
|
5 [ { ssh host "-l" username "mv" temp remote } short-running-process ] retry
|
||||||
] ;
|
] ;
|
||||||
|
|
||||||
: eval-file ( file -- obj )
|
: eval-file ( file -- obj )
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov.
|
! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: kernel namespaces accessors combinators make smtp debugger
|
USING: kernel namespaces accessors combinators make smtp debugger
|
||||||
prettyprint io io.streams.string io.encodings.utf8 io.files io.sockets
|
prettyprint sequences io io.streams.string io.encodings.utf8 io.files
|
||||||
mason.common mason.platform mason.config ;
|
io.sockets mason.common mason.platform mason.config ;
|
||||||
IN: mason.email
|
IN: mason.email
|
||||||
|
|
||||||
: prefix-subject ( str -- str' )
|
: prefix-subject ( str -- str' )
|
||||||
|
@ -18,11 +18,11 @@ IN: mason.email
|
||||||
send-email ;
|
send-email ;
|
||||||
|
|
||||||
: subject ( status -- str )
|
: subject ( status -- str )
|
||||||
{
|
[ current-git-id get 7 short head " -- " ] dip {
|
||||||
{ status-clean [ "clean" ] }
|
{ status-clean [ "clean" ] }
|
||||||
{ status-dirty [ "dirty" ] }
|
{ status-dirty [ "dirty" ] }
|
||||||
{ status-error [ "error" ] }
|
{ status-error [ "error" ] }
|
||||||
} case ;
|
} case 3append ;
|
||||||
|
|
||||||
: email-report ( report status -- )
|
: email-report ( report status -- )
|
||||||
[ "text/html" ] dip subject email-status ;
|
[ "text/html" ] dip subject email-status ;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
|
! Copyright (C) 2008, 2009 Eduardo Cavazos, Slava Pestov.
|
||||||
! See http://factorcode.org/license.txt for BSD license.
|
! See http://factorcode.org/license.txt for BSD license.
|
||||||
USING: io.directories io.files io.launcher kernel make
|
USING: io.directories io.files io.launcher kernel make
|
||||||
mason.common mason.config mason.platform namespaces prettyprint
|
namespaces prettyprint sequences mason.common mason.config
|
||||||
sequences ;
|
mason.platform ;
|
||||||
IN: mason.release.branch
|
IN: mason.release.branch
|
||||||
|
|
||||||
: branch-name ( -- string ) "clean-" platform append ;
|
: branch-name ( -- string ) "clean-" platform append ;
|
||||||
|
@ -21,7 +21,7 @@ IN: mason.release.branch
|
||||||
] { } make ;
|
] { } make ;
|
||||||
|
|
||||||
: push-to-clean-branch ( -- )
|
: push-to-clean-branch ( -- )
|
||||||
push-to-clean-branch-cmd short-running-process ;
|
5 [ push-to-clean-branch-cmd short-running-process ] retry ;
|
||||||
|
|
||||||
: upload-clean-image-cmd ( -- args )
|
: upload-clean-image-cmd ( -- args )
|
||||||
[
|
[
|
||||||
|
@ -36,7 +36,7 @@ IN: mason.release.branch
|
||||||
] { } make ;
|
] { } make ;
|
||||||
|
|
||||||
: upload-clean-image ( -- )
|
: upload-clean-image ( -- )
|
||||||
upload-clean-image-cmd short-running-process ;
|
5 [ upload-clean-image-cmd short-running-process ] retry ;
|
||||||
|
|
||||||
: (update-clean-branch) ( -- )
|
: (update-clean-branch) ( -- )
|
||||||
"factor" [
|
"factor" [
|
||||||
|
|
|
@ -12,7 +12,7 @@ IN: mason.report
|
||||||
target-cpu get
|
target-cpu get
|
||||||
host-name
|
host-name
|
||||||
build-dir
|
build-dir
|
||||||
"git-id" eval-file
|
current-git-id get
|
||||||
[XML
|
[XML
|
||||||
<h1>Build report for <->/<-></h1>
|
<h1>Build report for <->/<-></h1>
|
||||||
<table>
|
<table>
|
||||||
|
|
Loading…
Reference in New Issue