Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #38 from LimaoC/deployquickfix
Browse files Browse the repository at this point in the history
quickfix post test
  • Loading branch information
leadnaut authored Aug 30, 2024
2 parents 336d86e + 0bc147d commit 8cb6a70
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 3 additions & 2 deletions deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion deploypaths.txt
Original file line number Diff line number Diff line change
@@ -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
# should still work if all files are copied in
client/
pyproject.toml
poetry.lock

0 comments on commit 8cb6a70

Please sign in to comment.