-
Notifications
You must be signed in to change notification settings - Fork 1
/
deploy
executable file
·45 lines (27 loc) · 1.22 KB
/
deploy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
set -e
if [[ "$1" == "a" ]]
then
ssh acern mkdir -p /tmp/mize-src
ssh acern mkdir -p ~/work/modules
rsync -rv --exclude="target" --exclude="gitignore" ./* acern:/tmp/mize-src/
rsync -rv --exclude="target" --exclude="gitignore" --exclude="node_modules" ~/work/modules acern:work/
path=$(ssh acern /home/me/out/nix/bin/nix build /tmp/mize-src#webfiles -L --print-out-paths)
echo doneeeeeeeeeeeeeee building
echo path: $path
#scp -r acern:$path/* ocih:host/webserver/webfiles
tmp=$(mktemp -d)
[[ "$path" != "" ]] && rsync -rv -p --chmod=u+w acern:$path/* $tmp
[[ "$path" != "" ]] && rsync -rv $tmp/* ocih:host/data/my-website --rsync-path="sudo rsync"
elif [[ "$1" == "c" ]] # only copy files to acern
then
ssh acern mkdir -p /tmp/mize-src
ssh acern mkdir -p ~/work/modules
rsync -rv --exclude="target" --exclude="gitignore" ./* acern:/tmp/mize-src/
rsync -rv --exclude="target" --exclude="gitignore" --exclude="node_modules" ~/work/modules acern:work/
else
path=$(nix build .#webfiles -L -v --print-out-paths $@)
echo doneeeeeeeeeeeeeee building
echo path: $path
#scp -r $path/* ocih:host/webserver/webfiles
[[ "$path" != "" ]] && rsync -rv $path/* ocih:host/data/my-website --rsync-path="sudo rsync"
fi