diff options
author | tv <tv@krebsco.de> | 2015-03-19 22:48:22 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2015-05-19 23:10:57 +0200 |
commit | 7b652a9fdce1b5a3e877e64daf1c837d3cbd14e0 (patch) | |
tree | e0c4af16284311832e4a638c1ef4fa0212879d0c /run | |
parent | df5f8f38cc401efd972109b829f95daa7dc5f97f (diff) |
run: extract rsync_filter from deploy
Diffstat (limited to 'run')
-rwxr-xr-x | run | 14 |
1 files changed, 11 insertions, 3 deletions
@@ -17,6 +17,16 @@ deploy() {( main=$1 target=$2 + rsync_filter "$main" \ + | rsync -f '. -' -zvrlptD --delete-excluded ./ "$target":/etc/nixos/ + + ssh "$target" nixos-rebuild switch -I nixos-config=/etc/nixos/"$main" +)} + +# rsync_filter : nix-file -> rsync-filter +rsync_filter() {( + main=$1 + hosts=$(list_hosts) module_imports=$(set -euf; list_module_imports "$main") other_imports=$( @@ -43,9 +53,7 @@ deploy() {( rel_deps=$(echo "$abs_deps" | make_relative_to "$PWD") filter=$(echo "$rel_deps" | make_rsync_whitelist) - echo "$filter" \ - | rsync -f '. -' -zvrlptD --delete-excluded ./ "$target":/etc/nixos/ - ssh "$target" nixos-rebuild switch -I nixos-config=/etc/nixos/"$main" + echo "$filter" )} # list_module_imports : nix-file -> lines nix-file |