Last active
June 28, 2020 02:18
-
-
Save erm3nda/6b05680655c14c8e0c0c32126cdf9268 to your computer and use it in GitHub Desktop.
Example of remote rsync and building with buildozer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
user=YOUR_REMOTE_USERNAME | |
host=YOUR_HOST_IP | |
folder=REMOTE_SUBFOLDER | |
server=$user@$host | |
# delete local and remote apk builds | |
rm bin/* | |
ssh $server rm $folder/bin/* | |
# sync files | |
rsync -avP . $server:~/$folder --exclude=".*" | |
# run buildozer | |
ssh $server /bin/sh -c "PATH=$PATH:~/.local/bin; cd $folder; yes | ~/.local/bin/buildozer android debug" && \ | |
# copy built apk back | |
rsync -avP $server:/home/$user/$folder/bin/ ./bin && \ | |
# deploy and/or run if specified in commands | |
run_final_command=0 | |
for i; do | |
if [ $i == "deploy" ]; then | |
deploy="deploy" | |
run_final_command=1 | |
elif [ $i == "run" ]; then | |
run="run" | |
fi | |
done | |
if [ $run_final_command == "1" ]; then | |
buildozer android $deploy $run | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment