]> gitweb.factorcode.org Git - factor.git/blob - extra/mason/release/branch/branch.factor
Switch to https urls
[factor.git] / extra / mason / release / branch / branch.factor
1 ! Copyright (C) 2008, 2010 Eduardo Cavazos, Slava Pestov.
2 ! See https://factorcode.org/license.txt for BSD license.
3 USING: io.directories kernel make mason.common mason.config
4 mason.platform namespaces sequences ;
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" "-f" } %
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     5 [ push-to-clean-branch-cmd short-running-process ] retry ;
24
25 : upload-clean-image-cmd ( -- args )
26     [
27         scp-command get ,
28         target-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     5 [ upload-clean-image-cmd short-running-process ] retry ;
39
40 : update-clean-branch ( -- )
41     update-clean-branch? get [
42         "factor" [
43             push-to-clean-branch
44             upload-clean-image
45         ] with-directory
46     ] when ;