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