factor/extra/mason/release/branch/branch.factor

49 lines
1.3 KiB
Factor
Raw Normal View History

2008-09-16 00:20:33 -04:00
! Copyright (C) 2008 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 ;
2008-09-16 00:20:33 -04:00
IN: mason.release.branch
: branch-name ( -- string ) "clean-" platform append ;
: refspec ( -- string ) "master:" branch-name append ;
: push-to-clean-branch-cmd ( -- args )
[
"git" , "push" ,
[
branch-username get % "@" %
branch-host get % ":" %
branch-directory get %
] "" make ,
refspec ,
] { } make ;
: push-to-clean-branch ( -- )
push-to-clean-branch-cmd short-running-process ;
: upload-clean-image-cmd ( -- args )
[
2008-11-24 17:49:50 -05:00
scp-command get ,
2008-09-16 00:20:33 -04:00
boot-image-name ,
[
image-username get % "@" %
image-host get % ":" %
image-directory get % "/" %
platform %
] "" make ,
] { } make ;
: upload-clean-image ( -- )
upload-clean-image-cmd short-running-process ;
: (update-clean-branch) ( -- )
"factor" [
push-to-clean-branch
upload-clean-image
] with-directory ;
: update-clean-branch ( -- )
upload-to-factorcode? get [ (update-clean-branch) ] when ;