diff --git a/README.md b/README.md index 1d9c5dc..346fb24 100644 --- a/README.md +++ b/README.md @@ -86,11 +86,11 @@ a specified hostname and untar it there. To use the script execute it in the project's root directory with, ```bash -./deploy.sh [pathfile] [username]@[hostname] +./deploy.sh [pathfile] [hostname] [username] ``` For example, to deploy the files listed in `deploypaths.txt` to `testpi` (using username raspberry) the command would be ```bash -./deploy.sh deploypaths.txt raspberry@testpi +./deploy.sh deploypaths.txt testpi raspberry ``` The pathname file should contain a path to a file or directory on each line. If a directory is listed `deploy.sh` will copy the entire contents over. You can use the `#` character at the start of a line to leave comments. diff --git a/deploy.sh b/deploy.sh index c4d06d0..8c59b45 100755 --- a/deploy.sh +++ b/deploy.sh @@ -65,15 +65,16 @@ if ! nc -z $SSHTARGET 22 2>/dev/null; then exit 1 fi +SSHUSER=$3 echo -e "$INFO Copying Tarball - destination's password may be needed" -if ! scp -q $TARNAME $SSHTARGET:~/; then +if ! scp -q $TARNAME $SSHUSER@$SSHTARGET:~/; then echo -e "$ERROR Copy unsuccessful" cleanup exit 1 fi echo -e "$INFO Extracting Build - the password may be needed again" -if ! ssh $SSHTARGET "tar xf $TARNAME; rm $TARNAME"; then +if ! ssh $SSHUSER@$SSHTARGET "tar xf $TARNAME; rm $TARNAME" &> /dev/null; then echo -e "$ERROR Remote extraction failed" cleanup exit 1 diff --git a/deploypaths.txt b/deploypaths.txt index 5213d81..c4d0206 100644 --- a/deploypaths.txt +++ b/deploypaths.txt @@ -1,3 +1,6 @@ # Enter paths of files and directories to be bundled and sent to the pi # deploy.sh will preserve the source directory layout so imports between files -# should still work if all files are copied in \ No newline at end of file +# should still work if all files are copied in +client/ +pyproject.toml +poetry.lock