Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
683
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.55 KB | None | 0 0
  1. #!/bin/sh
  2.  
  3. # - Determine system and customer from pwd
  4. # - Pull branch from github (assuming it does exist)
  5.  
  6. CUSTOMER=`pwd | sed -e 's?.*/\(.*\)/\(.*\)?\1?'`
  7. SYSTEM=`pwd | sed -e 's?.*/\(.*\)/\(.*\)?\\2?'`
  8.  
  9. GIT_BASE="git://github.com/bigpandaio/customer-support"
  10.  
  11. echo "CUSTOMER: $CUSTOMER"
  12. echo "SYSTEM: $SYSTEM"
  13.  
  14. if [[ -e customer-support ]]; then
  15.     git clone $GIT_BASE
  16.     cd customer-support
  17.     git checkout "remotes/origin/feature/${CUSTOMER}/${SYSTEM}"
  18. else
  19.     cd customer-support
  20.     git pull origin "feature/${CUSTOMER}/${SYSTEM}"
  21. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement