init.sh 676 B

12345678910111213141516171819202122232425262728293031323334
  1. # place in root of zd code & change some vars & enjoy it!
  2. # exe in ~/
  3. # $1: bin name
  4. # $2: branch name
  5. # $3: checkout commit
  6. function do_one {
  7. mkdir $1
  8. cd $1
  9. pwd
  10. git init
  11. git remote add origin git@121.40.183.99:$1.git
  12. git fetch
  13. git checkout $3 -b $2
  14. git branch -d master
  15. git push origin $2
  16. git branch --set-upstream $2 origin/$2
  17. cd ..
  18. }
  19. cd zd_code
  20. branchname=test-server2
  21. cd p2p-back
  22. do_one zd_back_bin $branchname 8479c6f459f3478fba57aff48cf50f22fb4e271d
  23. cd ..
  24. cd p2p-front
  25. do_one zd_front_bin $branchname 2f58670d1dea2a7fac3c436428baafed9d0ab10b
  26. cd ..
  27. cd piaojuke_czbank_mobile
  28. do_one zd_mobile_bin $branchname a62634238f665b96d1f46ce62167f627fc1d0a78
  29. cd ..