2017-02-05 15:42:47 +01:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
# My little crappy deploy script
|
|
|
|
# Uploads all files not ignored by git
|
|
|
|
|
2017-02-06 20:20:25 +01:00
|
|
|
TARGET=grzegorz@brzeczyszczykiewicz.pvv.ntnu.no
|
2017-02-05 15:42:47 +01:00
|
|
|
TARGET_PATH='grzegorz'
|
|
|
|
|
|
|
|
array=(); while IFS= read -rd '' item; do array+=("$item"); done < \
|
|
|
|
<(git status -z --short | grep -z ^? | cut -z -d\ -f2-; git ls-files -z)
|
|
|
|
files_not_ignored=("${array[@]}")
|
|
|
|
|
2017-02-06 20:20:25 +01:00
|
|
|
ssh -T "$TARGET" "
|
2017-02-05 15:42:47 +01:00
|
|
|
rm -rf $TARGET_PATH
|
|
|
|
mkdir -p $TARGET_PATH
|
|
|
|
"
|
|
|
|
|
|
|
|
tar -c "${files_not_ignored[@]}" |
|
2017-02-06 20:20:25 +01:00
|
|
|
ssh -T "$TARGET" "
|
2017-02-05 15:42:47 +01:00
|
|
|
tar -vxC $TARGET_PATH
|
|
|
|
"
|
2017-02-06 20:20:25 +01:00
|
|
|
|
|
|
|
ssh -T "$TARGET" "
|
|
|
|
systemctl --user restart grzegorz@0
|
2017-02-05 15:42:47 +01:00
|
|
|
"
|
2018-02-24 21:30:43 +01:00
|
|
|
|
|
|
|
sleep 1
|
|
|
|
|
|
|
|
ssh -T "$TARGET" "
|
|
|
|
systemctl --user status grzegorz@0
|
|
|
|
"
|