Last active
November 3, 2016 07:10
-
-
Save jsgao0/7e0b02f2db56de54c3898471b71d67f9 to your computer and use it in GitHub Desktop.
Git hooks: change directory, git pull, mvn package, scp.
This file contains hidden or 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 | |
while read oldrev newrev ref | |
do | |
if [[ $ref =~ .*/master$ ]]; | |
then | |
cd /git/project/path || exit | |
unset GIT_DIR | |
git pull | |
mvn clean package | |
sshpass -p password scp from_path username@remote_url:to_path | |
else | |
echo "Not master" | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment