-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathrun.sh
More file actions
29 lines (26 loc) · 719 Bytes
/
run.sh
File metadata and controls
29 lines (26 loc) · 719 Bytes
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
#!/bin/bash
HOST=$1
PROJECT=$(basename $(pwd))
PACKAGE=$(dirname $(ls */__main__.py))
rsync -rPv --delete "$(pwd)/" $HOST:~/${PROJECT}/
case "$2" in
"req")
ssh -t "${HOST}" pip3 install -r /home/$USER/${PROJECT}/tests/requirements.txt
ssh -t "${HOST}" pip3 install -r /home/$USER/${PROJECT}/requirements.txt
;;
"main")
ssh -t "${HOST}" "cd ${PROJECT} ; python3 -m ${PACKAGE}"
;;
"test")
ssh -t "${HOST}" "cd ${PROJECT} ; nose2-3 "
;;
"install")
ssh -t ${HOST} "cd ${PROJECT} ; python3 -m pip install --upgrade --user --verbose ."
;;
"copy")
echo "Just copy and done"
;;
*)
exit 4
;;
esac