Make scp and ssh commands configurable

db4
Slava Pestov 2008-11-24 16:49:50 -06:00
parent 12d4f684ec
commit 499cc882ac
4 changed files with 16 additions and 7 deletions

View File

@ -15,9 +15,11 @@ IN: mason.common
:: upload-safely ( local username host remote -- )
[let* | temp [ remote ".incomplete" append ]
scp-remote [ { username "@" host ":" temp } concat ] |
{ "scp" local scp-remote } short-running-process
{ "ssh" host "-l" username "mv" temp remote } short-running-process
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
] ;
: eval-file ( file -- obj )

View File

@ -1,6 +1,6 @@
! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: system io.files namespaces kernel accessors ;
USING: system io.files namespaces kernel accessors assocs ;
IN: mason.config
! (Optional) Location for build directories
@ -77,3 +77,10 @@ SYMBOL: upload-username
! Directory with binary packages.
SYMBOL: upload-directory
! Optional: override ssh and scp command names
SYMBOL: scp-command
scp-command global [ "scp" or ] change-at
SYMBOL: ssh-command
ssh-command global [ "ssh" or ] change-at

View File

@ -14,6 +14,7 @@ USING: mason.release.branch mason.config tools.test namespaces ;
[ { "scp" "boot.unix-x86.64.image" "joe@blah.com:/stuff/clean/netbsd-x86-64" } ] [
[
"scp" scp-command set
"joe" image-username set
"blah.com" image-host set
"/stuff/clean" image-directory set

View File

@ -1,8 +1,7 @@
! Copyright (C) 2008 Eduardo Cavazos, Slava Pestov.
! See http://factorcode.org/license.txt for BSD license.
USING: kernel namespaces sequences prettyprint io.files
io.launcher make
mason.common mason.platform mason.config ;
io.launcher make mason.common mason.platform mason.config ;
IN: mason.release.branch
: branch-name ( -- string ) "clean-" platform append ;
@ -25,7 +24,7 @@ IN: mason.release.branch
: upload-clean-image-cmd ( -- args )
[
"scp" ,
scp-command get ,
boot-image-name ,
[
image-username get % "@" %