Last active
March 23, 2018 19:52
-
-
Save knikolla/a921573ded94538796ee5ce1383eb1fb to your computer and use it in GitHub Desktop.
Rsync the current directory to a remote location and execute tox
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
#!/usr/bin/env bash | |
# ENV variables required: | |
# SSH_DEST: destination directory as would have been specified | |
# to rsync or scp. ex. [email protected]:~ | |
# Get the name of the target directory | |
TARGET=$(basename `pwd`) | |
# Clean up | |
rm -rf .tox | |
rm -rf .testrepository | |
cd ../ | |
# rsync with recursive update flag and run | |
rsync -ah --exclude-from ~/rsync-exclude.txt $TARGET $SSH_DEST | |
LOG_FILE="$TARGET_`date +%Y-%m-%d:%H:%M:%S`" | |
ssh -tt $SSH_DEST "cd ~/$TARGET && tox $@" | tee ../$LOG_FILE |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment