Skip to content

Instantly share code, notes, and snippets.

@erm3nda
Last active June 28, 2020 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erm3nda/6b05680655c14c8e0c0c32126cdf9268 to your computer and use it in GitHub Desktop.
Save erm3nda/6b05680655c14c8e0c0c32126cdf9268 to your computer and use it in GitHub Desktop.
Example of remote rsync and building with buildozer
#!/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