Created
March 2, 2016 17:14
-
-
Save patmcnally/14004f9c688e2b5bf674 to your computer and use it in GitHub Desktop.
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
repo=$(git rev-parse --show-toplevel); | |
repo="${repo/\/Volumes\/CODE\//}"; | |
repo="${repo/\/var\/www\/html\/announcemedia\//}"; | |
branch=`git rev-parse --abbrev-ref HEAD`; | |
if [ "$branch" == "HEAD" ]; then | |
branch=""; | |
else | |
branch="(BRANCH: $branch)"; | |
fi; | |
deploy="# $(basename "$repo") $branch"; | |
nl=" | |
"; | |
if [ ${repo:0:15} == "sql_deployments" ]; then | |
deploy="$deploy${nl}cd /var/www/html/announcemedia/$repo;${nl}sudo gitsqldeploy $(git rev-parse HEAD);"; | |
elif [ ${repo} == "server_configs" ]; then | |
deploy="$deploy${nl}cd /var/www/html/announcemedia/$repo;${nl}sudo gitswitch $(git rev-parse HEAD);${nl}# restart apache${nl}sudo /etc/init.d/httpd reload;"; | |
else | |
deploy="$deploy${nl}cd /var/www/html/announcemedia/$repo;${nl}sudo gitswitch $(git rev-parse HEAD);"; | |
fi; | |
echo "$deploy" | pbcopy; | |
printf "${deploy}\n"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment