]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/release/branch/branch.factor
Fixing load-everything for io.files split
[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: io.directories io.files io.launcher kernel make
4 mason.common mason.config mason.platform namespaces prettyprint
5 sequences ;
6 IN: mason.release.branch
7
8 : branch-name ( -- string ) "clean-" platform append ;
9
10 : refspec ( -- string ) "master:" branch-name append ;
11
12 : push-to-clean-branch-cmd ( -- args )
13     [
14         "git" , "push" ,
15         [
16             branch-username get % "@" %
17             branch-host get % ":" %
18             branch-directory get %
19         ] "" make ,
20         refspec ,
21     ] { } make ;
22
23 : push-to-clean-branch ( -- )
24     push-to-clean-branch-cmd short-running-process ;
25
26 : upload-clean-image-cmd ( -- args )
27     [
28         scp-command get ,
29         boot-image-name ,
30         [
31             image-username get % "@" %
32             image-host get % ":" %
33             image-directory get % "/" %
34             platform %
35         ] "" make ,
36     ] { } make ;
37
38 : upload-clean-image ( -- )
39     upload-clean-image-cmd short-running-process ;
40
41 : (update-clean-branch) ( -- )
42     "factor" [
43         push-to-clean-branch
44         upload-clean-image
45     ] with-directory ;
46
47 : update-clean-branch ( -- )
48     upload-to-factorcode? get [ (update-clean-branch) ] when ;