]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/release/branch/branch.factor
Merge branch 'master' into experimental (untested!)
[factor.git] / extra / mason / release / branch / branch.factor
1 ! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: kernel namespaces sequences prettyprint io.files
4 io.launcher make mason.common mason.platform mason.config ;
5 IN: mason.release.branch
6
7 : branch-name ( -- string ) "clean-" platform append ;
8
9 : refspec ( -- string ) "master:" branch-name append ;
10
11 : push-to-clean-branch-cmd ( -- args )
12     [
13         "git" , "push" ,
14         [
15             branch-username get % "@" %
16             branch-host get % ":" %
17             branch-directory get %
18         ] "" make ,
19         refspec ,
20     ] { } make ;
21
22 : push-to-clean-branch ( -- )
23     push-to-clean-branch-cmd short-running-process ;
24
25 : upload-clean-image-cmd ( -- args )
26     [
27         scp-command get ,
28         boot-image-name ,
29         [
30             image-username get % "@" %
31             image-host get % ":" %
32             image-directory get % "/" %
33             platform %
34         ] "" make ,
35     ] { } make ;
36
37 : upload-clean-image ( -- )
38     upload-clean-image-cmd short-running-process ;
39
40 : (update-clean-branch) ( -- )
41     "factor" [
42         push-to-clean-branch
43         upload-clean-image
44     ] with-directory ;
45
46 : update-clean-branch ( -- )
47     upload-to-factorcode? get [ (update-clean-branch) ] when ;